跪求兄弟姐妹來看看我的程序為什么沒有輸出??明明沒有報錯,邏輯也感覺沒有問題
#include <stdio.h>
int main()
{
? ? int score[10]={67,98,75,63,82,79,81,91,66,84};
? ? void allgrade();
? ? void mostgrade();
? ? void lowgrade();
? ? void average();
? ? void gradedown();
? ? ?
? ? return 0;
}
void allgrade()
{
? ? int score[10]={67,98,75,63,82,79,81,91,66,84};
? ? int i;
? ? int temp;
? ? int sum=0;
? ? for(i=0;i<10;i++)
? ? {
? ? ? ? temp=score[i];
? ? ? ? sum=temp+sum;
? ? }
? ? printf("總分%d \n",sum);
}
void mostgrade()
{
int score[10]={67,98,75,63,82,79,81,91,66,84};
? ? int store;
? ? int i;
? ? for(i=0;i<9;i++)
? ? {
? ? ? ? if(score[i]>score[i+1])
? ? ? ? {
? ? ? ? ? ? score[i+1]=score[i];
? ? ? ? ? ? store=score[i+1];
? ? ? ? }
? ? }
? ? printf("最高分是%d\n",store);
}
void lowgrade()
{
int score[10]={67,98,75,63,82,79,81,91,66,84};
? ? int story;
? ? int i;
? ? for(i=0;i<9;i++)
? ? {
? ? ? ? if(score[i]<score[i+1])
? ? ? ? {
? ? ? ? score[i+1]=score[i];
? ? ? ? story=score[i+1];
? ? ? ? }
? ? }
? ? printf("最低分是%d\n",story);
}
void average()
{
int score[10]={67,98,75,63,82,79,81,91,66,84};
? ? int i;
? ? int temp;
? ? int sum=0;
? ? int average1;
? ? for(i=0;i<10;i++)
? ? {
? ? ? ? temp=score[i];
? ? ? ? sum=temp+sum;
? ? }
? ? average1=sum/10;
? ? printf("平均分%d\n",average1);
}
void gradedown()
{
? ? int score[10]={67,98,75,63,82,79,81,91,66,84};
? ? int store;
? ? int i;
? ? for(i=0;i<9;i++)
? ? {
? ? ? ? if(score[i]>score[i+1])
? ? ? ? {
? ? ? ? ? ? ?store=score[i+1];
? ? ? ? ? ? score[i+1]=score[i];
? ? ? ? ? ? score[i]=store;
? ? ? ? }
? ? }
? ? for(i=0;i<9;i++)
? ? {
? ? ? ? printf("%d ?,",score[i]);
? ? }
}
2016-09-15
不用跪求...解決了問題記得采納回答者就行了!
2016-09-15
當然不是,采納這個很重要嗎?