KiKi参加了语文、数学、外语的考试,请帮他判断三科中的最高分。从键盘任意输入三个整数表示的分数,编程判断其中的最高分。
数据范围:
while True: try: lt = max(map(int,input().split())) print(lt) except: break
import java.util.*; public class Main { public static void main(String [] args) { Scanner sc=new Scanner(System.in); int[] arr = new int[3]; while(sc.hasNext()){ for(int i=0;i<=arr.length-1;i++){ arr[i] = sc.nextInt(); } Arrays.sort(arr); System.out.println(arr[2]); } } }
#include <stdio.h> int main() { int c,m,e; while(scanf("%d %d %d",&c,&m,&e)!=EOF) { if(c>m) m=c; if(m>e) e=m; printf("%d\n",e); } return 0; }
import java.util.Scanner; public class Main{ public static void main(String[] agrs){ Scanner sc = new Scanner(System.in); while(sc.hasNext()){ int a = sc.nextInt(); int b = sc.nextInt(); int c = sc.nextInt(); int res = a > b ? a : b; res = res > c ? res : c; System.out.println(res); } } }
#include <stdio.h> int main() { int a = 0; int max = 0; while((scanf("%d",&a))!=EOF) { if(a>max) max = a; } printf("%d\n",max); return 0; }