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 人评分
DNA (C语言描述,数据结构)浏览:901 |
用筛法求之N内的素数。 (C语言代码)浏览:680 |
母牛的故事 (C语言代码)浏览:1007 |
川哥的吩咐 (C语言代码)浏览:661 |
输出九九乘法表 (C语言代码)浏览:1168 |
输入输出格式练习 (C语言代码)浏览:765 |
1052题解(链表操作)浏览:778 |
C语言程序设计教程(第三版)课后习题5.8 (C语言代码)浏览:687 |
C语言程序设计教程(第三版)课后习题6.5 (C语言代码)浏览:503 |
简单的a+b (C语言代码)浏览:668 |