解题思路:
注意事项:
参考代码:
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
int x = s.nextInt();
int y = s.nextInt();
char m = s.next().charAt(0);
char n = s.next().charAt(0);
String p = s.next();
String q = s.next();
System.out.println(Compare(x, y));
System.out.println(Compare(m, n));
System.out.println(Compare(p, q));
}
public static int Compare(int a, int b) {
if (a > b)
return a;
else
return b;
}
public static int Compare(char a, char b) {
return Math.abs((int) a - (int) b);
}
public static String Compare(String a, String b) {
if (a.compareTo(b) > 0) {
return a;
} else {
return b;
}
}
}
0.0分
0 人评分
【出圈】 (C语言代码)用单项循环链表浏览:773 |
点我有惊喜!你懂得!浏览:1338 |
点我有惊喜!你懂得!浏览:1395 |
震宇大神的杀毒软件 (C++代码)浏览:1117 |
C语言训练-求矩阵的两对角线上的元素之和 (C语言代码)浏览:602 |
C语言程序设计教程(第三版)课后习题8.2 (C语言代码)浏览:5232 |
水仙花 (C语言代码)浏览:1053 |
愚蠢的摄影师 (C++代码)浏览:938 |
杨辉三角 (C语言代码)浏览:484 |
GC的苦恼 (C语言代码)浏览:621 |