anonymous No title
No License C
2020年01月23日
Copy Clone
#include<stdio.h>
#include<stdlib.h>
struct SEITO{
 char ID;
 int  sj;
 int  sm;
 int  se;
};
int main()
{
struct SEITO seito;


 FILE *f ;
 float x[100], xmax ;
 int i,j,a,b,c,d;
 char ID[50];
 int sj[50];
 int sm[50];
 int se[50] ;
  
if((f= fopen("final_150217.txt","r"))== NULL)
{ printf("Can't open file: %s\n","final_150217.txt")  ;
   return 1 ;
 }else{
 	 printf("Opened file;%s\n","final_150217.txt");
  }
  
 for(i=0 ; i<10 ; i=i+1 ){ 
 if(fscanf(f,"%s %d %d %d",ID,&sj,&sm,&se)!=4)
   { 
    break;
    }
  }
 fclose(f);
  printf("a\n");
 for(i=0 ; i<9 ;i++)
 {
   x[i]=sj[i]+sm[i]+se[i];
   printf("b\n");
 }
 for(i=0 ; i<9 ; i++)
  { printf("c\n");
   for(j=1+i ;j<10 ;j++)
   {printf("d\n");
 	 if(x[i]<x[j]) 
 	 {
       xmax =x[i];
       x[i]=x[j];
       x[j]=xmax;
      }
    }
   }
 printf("点:%d\n",xmax);
 printf("一位:ID:%s\n",ID[i]) ;
 printf("二位:ID:%s\n",ID[i]) ;
 printf("三位:ID:%s\n",ID[i]) ;
return 0 ;
}
#include<stdio.h>
#include<stdlib.h>
struct SEITO{
 char ID;
 int  sj;
 int  sm;
 int  se;
};
int main()
{
struct SEITO seito;


 FILE *f ;
 float x[100], xmax ;
 int i,j,a,b,c,d;
 char ID[50];
 int sj[50];
 int sm[50];
 int se[50] ;
  
if((f= fopen("final_150217.txt","r"))== NULL)
{ printf("Can't open file: %s\n","final_150217.txt")  ;
   return 1 ;
 }else{
 	 printf("Opened file;%s\n","final_150217.txt");
  }
  
 for(i=0 ; i<10 ; i=i+1 ){ 
 if(fscanf(f,"%s %d %d %d",ID,&sj,&sm,&se)!=4)
   { 
    break;
    }
  }
 fclose(f);
  printf("a\n");
 for(i=0 ; i<9 ;i++)
 {
   x[i]=sj[i]+sm[i]+se[i];
   printf("b\n");
 }
 for(i=0 ; i<9 ; i++)
  { printf("c\n");
   for(j=1+i ;j<10 ;j++)
   {printf("d\n");
 	 if(x[i]<x[j]) 
 	 {
       xmax =x[i];
       x[i]=x[j];
       x[j]=xmax;
      }
    }
   }
 printf("点:%d\n",xmax);
 printf("一位:ID:%s\n",ID[i]) ;
 printf("二位:ID:%s\n",ID[i]) ;
 printf("三位:ID:%s\n",ID[i]) ;
return 0 ;
}
No one still commented. Please first comment.