感覺(jué)沒(méi)有錯(cuò)啊
#include <stdio.h>
int main()
{
? ? int score[10]={67,98,75,63,82,79,81,91,66,84};
? ? int i,j;
? ? int temp;
? ? for(i=0;i<10;i++)
? ? ? ? for(j=0;j<10;j++)
? ? ? ? {
? ? ? ? ? ? if(score[j]<score[j+1])
? ? ? ? ? ? {
? ? ? ? ? ? ? ? temp=score[j];
? ? ? ? ? ? ? ? score[j]=score[j+1];
? ? ? ? ? ? ? ? score[j+1]=temp;
? ? ? ? ? ? }
? ? ? ??
? ? ? ? }
? ? for(i=0;i<10;i++)
? ? {
? ? ? ? printf("%d\n",score[i]);
? ? }
? ? ? ? return(0);
}
2016-12-27
int main()
{
? ? int score[10]={67,98,75,63,82,79,81,91,66,84};
? ? int i,j;
? ? int temp;
? ? for(i=0;i<10;i++)
? ? ? { ?for(j=0;j<10;j++)
? ? ? ? {
? ? ? ? ? ? if(score[j]<score[j+1])
? ? ? ? ? ? {
? ? ? ? ? ? ? ? temp=score[j];
? ? ? ? ? ? ? ? score[j]=score[j+1];
? ? ? ? ? ? ? ? score[j+1]=temp;
? ? ? ? ? ? }
? ? ? ? }
? ? ? ?}
? ? for(i=0;i<10;i++)
? ? {
? ? ? ? printf("%d\n",score[i]);
? ? }
? ? ? ? return(0);
}
第一個(gè)for循環(huán)應(yīng)該加“{}”