D1
题目描述
import java.util.Scanner; public class L1004 { public static void main(String[] args) { //给定一个华氏温度F,本题要求编写程序,计算对应的摄氏温度C。 // 计算公式:C=5×(F−32)/9。题目保证输入与输出均在整型范围内。 Scanner sc = new Scanner(System.in); int input = sc.nextInt(); int c = 5*(input - 32)/9; System.out.println("Celsius = "+c); } } 123456789101112131415
题目描述
import java.util.Scanner; public class L1012 { //真的没骗你,这道才是简单题 —— 对任意给定的不超过 10 的正整数 n,要求你输出 2的n次方 public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); if(n <= 10){ int r = (int)Math.pow(2.0,123456789