政府工作量化指标数据:编程序统计低于60,60-69,70-79,80-89,90-99,100的学生人数,并存放在 S5,S6,S7,S8,S9,S10单元中

来源:百度文库 编辑:高校问答 时间:2024/04/26 20:34:50
假设有100个学生的成绩分别是:
编程序统计低于60,60-69,70-79,80-89,90-99,100的学生人数,并存放在 S5,S6,S7,S8,S9,S10单元中
用汇编写

#define N 26 //the number of the students
unsigned char score[N];//the score of the students
unsigned int i,s5,s6,s7,s8,s9,s10;

for(i-0;i<N;i++)
if(score[i]<60)
s5++;
else if(score[i]<70)
s6++;
else if(score[i]<80)
s7++;
else if(score[i]<90)
s8++;
else if(score[i]<100)
s9++;
else s10++;