解题思路:
注意事项:
参考代码:
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int x = scanner.nextInt(); int y; if (x < 1) { y = x; System.out.println(y); } else if (1 <= x && x < 10) { y = (2 * x) - 1; System.out.println(y); } else if (x >= 10) { y = (3 * x) - 11; System.out.println(y); } } }
0.0分
0 人评分