也许还会爱
2016-03-26 13:52
#include <stdio.h>
int main()
{
int score[10]={67,98,75,63,82,79,81,91,66,84};
int i;
int sum=0;
int number;
if(i=0,i<10,i++)
{
sum+=score[i];
}
return sum;
if(score[i]>score[i+1])
{
score[i]=number;
score[i]=score[i+1];
score[i+1]=number;
}
printf("%d/n",sum);
printf("%d\n",sum/10);
printf("%d/n",score[9]);
printf("%d/n",score[0]);
printf("%d\n",score[i]);
return 0;
}
#include <stdio.h> int main() { int score[10]={67,98,75,63,82,79,81,91,66,84}; int i; int sum=0; int number; //if(i=0,i<10,i++)--怎么能这么用 for(i=0;i<10;i++) { sum+=score[i]; } //return sum;//------去掉 for(i = 0;i < 9;i++)//升序排序 { if(score[i]>score[i+1]) { //score[i]=number; number = score[i]; score[i]=score[i+1]; score[i+1]=number; } } //printf("%d/n",sum); printf("%d\n",sum); printf("%d\n",sum/10); //printf("%d/n",score[9]); //printf("%d/n",score[0]); printf("%d\n",score[9]); printf("%d\n",score[0]); printf("%d\n",score[i]); return 0; }
你没有定义number是什么
C语言入门
926212 学习 · 20797 问题
相似问题