#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★ 閱讀(423)
評論(0) 編輯 收藏 所屬分類:
C/C++語言算法總結