#define M 5
main()
{
int score[M]={78,90,67,88,99};
float average;
int i,sum,high;
for(i=0,sum=0,high=0;i<M;i++)
{
sum+=score[i];
if(score[i]>high) high=score[i];
if(i==M-1) printf("%d.",score[i]);
else printf("%d,",score[i]);
}
average=(float)sum/M;
printf("\n%d,",high);
printf("%d,",sum);
printf("%f.",average);
getch();
}
posted on 2007-08-03 09:56
★yesjoy★ 阅读(381)
评论(0) 编辑 收藏 所属分类:
C/C++语言算法总结