例1:求学生的平均分 1 public static void main(String[] args) { 2 Scanner input=new Scanner(System.in); 4 int scores []=new int[5]; 5 int sum=0; 6 7 System.out.
分类:
编程语言 时间:
2016-02-09 08:59:36
阅读次数:
290
例1:求学生的平均分 1 public static void main(String[] args) { 2 Scanner input=new Scanner(System.in); 4 int scores []=new int[5]; 5 int sum=0; 6 7 System.out.
分类:
编程语言 时间:
2016-01-31 21:50:24
阅读次数:
368
一数组的定义
数组可以理解为是一个巨大的"盒子",里面可以按顺序存放多个类型相同的数据,比如可以定义int型的数组
scores存储4名学生的成绩。
数组中的元素都可以通过下标来访问,下标从0开始。例如,可以通过scores[0]获取数组中的第一个元素76,
scores[2]就可以取到第三个元素92。
二操作数组只需要四个步骤:
...
分类:
编程语言 时间:
2016-01-24 22:33:36
阅读次数:
246
在慕课网学习的时候遇到了这样一个Java编程练习题,正好对所学习的Java基础知识检验一下:
请根据所学知识,编写一个Java程序,实现输出考试成绩的前三名
要求:
1考试成绩已保存在数组scores中,数组元素依次为89 , -23 , 64 , 91 , 119 , 52 , 73
2要求通过自定义方法来实现成绩排名并输出操作,将成绩数组作为参数传入
3要求判断成绩的有效性( 0—10...
分类:
编程语言 时间:
2016-01-23 23:19:16
阅读次数:
472
scores={}result_f=open("results.txt")for line in result_f: (name,score)=line.split() scores[score]=nameresult_f.close()print("The top scores wer...
分类:
数据库 时间:
2016-01-23 17:50:40
阅读次数:
206
(1)变量:用来存储数据,一个数据。 不同的数据,我们定义不同类型的变量存储。 利用数组简单化处理:int[]scores=new int[37] (2)数组就是一个变量,用于将相同数据类型的数据存储在内存中。 声明一个变量就是在内存空间中划出一串连续的空间。 (3)数组的基本要素:...
分类:
编程语言 时间:
2015-12-21 23:42:38
阅读次数:
192
Problem DescriptionAfter getting 600 scores in NOIP ZYB(ZJ?267) begins to work with biological questions.Now he give you a simple biological questions...
分类:
其他好文 时间:
2015-12-10 21:30:04
阅读次数:
140
ZYB's PrimeTime Limit: 20 SecMemory Limit: 256 MB题目连接http://acm.hdu.edu.cn/showproblem.php?pid=5594DescriptionAfter getting 600 scores in NOIP,ZYB(ZJ?...
分类:
其他好文 时间:
2015-12-06 14:35:00
阅读次数:
266
The ranklist of PAT is generated from the status list, which shows the scores of the submittions. This time you are supposed to generate the ranklist ...
分类:
其他好文 时间:
2015-12-06 13:09:04
阅读次数:
240
map是一组键值对的结构,具有极快的查找速度。例如:查找学生的成绩,普通Arry数组操作会创建两个普通的Arryvar name = {'aaaa','bbbb','cccc'};var scores = { 96,97,98 }给定一个名字,要查找对应的成绩,就先要在names中找到对应的位置,再...
分类:
编程语言 时间:
2015-11-03 19:33:43
阅读次数:
141