解题思路:
注意事项:
参考代码:
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int[] a=new int[50]; int b=0; for (int i = 0; i < a.length; i++) { a[i]=sc.nextInt(); if(a[i]==-1) { b=i-1; break; } } int c=a[0]; for (int i = 1; i <=b; i++) { if(c<a[i]) { c=a[i]; } } System.out.println(c); } }
0.0分
0 人评分
字符串的输入输出处理 (C语言代码)浏览:2020 |
C语言程序设计教程(第三版)课后习题10.3 (C语言代码)浏览:561 |
C语言程序设计教程(第三版)课后习题5.7 (C语言代码)浏览:812 |
C二级辅导-计负均正 (C语言代码)浏览:657 |
C语言训练-计算1~N之间所有奇数之和 (C语言代码)浏览:651 |
【出圈】 (C语言代码)浏览:558 |
【明明的随机数】 (C++代码)浏览:781 |
C语言程序设计教程(第三版)课后习题1.5 (C语言代码)浏览:483 |
WU-输出正反三角形 (C++代码)浏览:1019 |
C语言程序设计教程(第三版)课后习题8.5 (C语言代码)浏览:576 |