其他分享
首页 > 其他分享> > 统计输入正数个数

统计输入正数个数

作者:互联网

 

 

import java.util.*;

public class Main {
public static void main(String[] args) {
int count = 0;
Scanner scanner = new Scanner(System.in);

//write your code here......
while(scanner.nextInt() > 0){
count++;

}
System.out.println(count);

}
}

标签:count,code,scanner,个数,System,正数,public,输入,Scanner
来源: https://www.cnblogs.com/wujiheng/p/16603447.html