這樣運行成功 但是并沒有顯示任何內容 請大佬指點
#include <stdio.h>
#define N 10
int main()
{
??? int score[N]={67,98,75,63,82,79,81,91,66,84};
??? int sum,max,min,average;
??? int number(int score[N)
??? {
??????? int i,j;
??????? for(i=0;i<10;i++)
??????? {
??????????? for(j=0;j<i;j++)
??????????? {
??????????????? if(score[i]<score[j])
??????????????? {
??????????????????? int temp;
??????????????????? temp=score[i];
??????????????????? score[i]=score[j];
??????????????????? score[j]=temp;
??????????????? }
??????????? }
??????? }
??? for(i=0;i<10;i++)
??????? {
??????????? printf("%d ",score[i]);
??????? }
??? }
???
??? return 0;
???
???
??
}
2019-08-19
你的int number(int score[N) 里面for(i=0;i<10;i++)
??????? {
??????????? printf("%d ",score[i]);
??????? }
??? }后面要有return 0;
要么你定義為void不用返回值。
2019-08-03
數組定義score[N]有問題,題目也是讓你自己定義5個函數計算,不是直接在主函數里寫
2019-07-28
首先,應該必不可能運行成功的吧。int number(int score[N)
其次,函數里面應該不能定義函數的吧。