投票统计的数组用法
来源:互联网 发布:linux nginx开机启动 编辑:程序博客网 时间:2024/06/06 01:17
package welcome;
import java.util.Scanner;
public class 投票统计 {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner in = new Scanner(System.in);
int x;
x = in.nextInt();
int [] a= new int[10];
while(x != -1)
{
if(x >= 0 && x <= 9)
{
a[x]++;
}
x = in.nextInt();
}
for(int i = 0; i < 10; i++)
{
System.out.println(a[i]);
}
}
}
import java.util.Scanner;
public class 投票统计 {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner in = new Scanner(System.in);
int x;
x = in.nextInt();
int [] a= new int[10];
while(x != -1)
{
if(x >= 0 && x <= 9)
{
a[x]++;
}
x = in.nextInt();
}
for(int i = 0; i < 10; i++)
{
System.out.println(a[i]);
}
}
}
阅读全文
0 0
- 投票统计的数组用法
- 统计投票
- 投票统计—投票过滤器类的设计与实现
- 5-1-4 例子:投票统计-运用数组下标
- datetabled的用法及一个投票
- 投票统计 js
- 候选人投票统计
- 关于网站统计或投票系统的多种方法---JSP
- java实现0-9数字统计个数的投票计数
- 投票统计模块(asp.net)
- 第6章 统计成绩(数组用法)
- 有三个候选人,每个选民只能投票选一人要求编一个统计选票的程序
- 统计数组的逆序对
- 华为机试题目之投票统计
- Problem G: B 结构体--统计投票
- [YTU]_2624( B 结构体--统计投票)
- 网上投票的制作
- 有意思的投票结果
- Dense Structural Learning for Infrared Object Tracking
- java基础,每日三题(String、==、equals、数组)
- bzoj2705 欧拉函数
- Work Statement-First
- Android Studio获取开发版SHA1值和发布版SHA1值的方法
- 投票统计的数组用法
- 计算机网络知识解析
- JS——面向对象(1)
- 深入理解 Java 垃圾回收机制
- wpf数据绑定——radiobutton绑定枚举值并显示枚举值
- 使用fastText进行文本分类及源码分析时的一点感受
- Spring框架:跨域问题之使用@CrossOrigin注解解决失败的原因总结
- python学习笔记--event事件
- Java----枚举 enum