解题思路:
注意事项:
参考代码:
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语言代码)答案错误????浏览:597 |
C语言考试练习题_排列 (C语言代码)浏览:725 |
简单的a+b (C语言代码)浏览:695 |
兰顿蚂蚁 (C++代码)浏览:1049 |
C语言训练-求函数值 (C语言代码)浏览:580 |
WU-蓝桥杯算法提高VIP-勾股数 (C++代码)浏览:1607 |
C语言程序设计教程(第三版)课后习题8.2 (C语言代码)浏览:5232 |
C语言程序设计教程(第三版)课后习题6.3 (C语言代码)浏览:660 |
C语言程序设计教程(第三版)课后习题8.7 (C语言代码)浏览:596 |
C语言程序设计教程(第三版)课后习题9.6 (C语言代码)浏览:373 |