1069745273


私信TA

用户名:1069745273

访问量:6167

签 名:

Just do IT.

等  级
排  名 258
经  验 5862
参赛次数 3
文章发表 166
年  龄 0
在职情况 待业
学  校
专  业 计算机科学与技术

  自我简介:

import java.io.*;

public class Main {
    public static BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    public static BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out));
    public static StreamTokenizer cin = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));
    public static PrintWriter cout = new PrintWriter(new OutputStreamWriter(System.out));

    public static void main(String[] args) throws Exception {
        double x, y;
        cin.nextToken();
        x = cin.nval;
        if (x < 1) {
            y = x;
        } else if (x >= 1 && x < 10) {
            y = 2 * x - 1;
        } else {
            y = 3 * x - 11;
        }
        cout.printf("%.0f", y);// 这里注意不能用 cin.print() 或者 cin.println(),会默认带一位小数。
        cout.flush();
    }
}


 

0.0分

0 人评分

  评论区

  • «
  • »