题解 | #小乐乐找最大数#

小乐乐找最大数

http://www.nowcoder.com/practice/ae6a21920cac4f9184c8ecfcc87f89b9

import java.util.Scanner;
public class Main {
    
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int max = Integer.MIN_VALUE;
        int num;
        while(sc.hasNextInt()) {
            num = sc.nextInt();
            if(num > max) {
                max = num;
            }
        }
        System.out.println(max);
    }
}
全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务