P5703题目链接
其实long貌似够了,用了一下BigInteger保险也行吧……反正水题嘛
import java.math.BigInteger;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
String a = scanner.next(), b = scanner.next();
System.out.println(new BigInteger(a).multiply(new BigInteger(b)));
}
}
P5704题目链接
toUpperCase()直接小写变大写,Fine……
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.println(scanner.nextLine().toUpperCase());
scanner.close();
}
}
P5705题目链接
数值反转的一种情况吧,就是小数,很简单啦。
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
char[] chars = scanner.nextLine().toCharArray();
for (int i = chars.length-1; i >= 0; i--) {
System.out.print(chars[i]);
}
scanner.close();
}
}
P5706题目链接
除法然后格式化输出一下,一定要用浮点,Fine……
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
double all = scanner.nextDouble();
int num = scanner.nextInt();
scanner.close();
System.out.printf("%.3f\n", all/num);
System.out.println(2*num);
}
}