Aktualizovat „du5/program.c“
This commit is contained in:
		
							parent
							
								
									910fa65ef7
								
							
						
					
					
						commit
						fc861aa2b6
					
				@ -38,26 +38,26 @@ int main(){
 | 
				
			|||||||
	int score=0;
 | 
						int score=0;
 | 
				
			||||||
	int c =0;
 | 
						int c =0;
 | 
				
			||||||
	char str[100];
 | 
						char str[100];
 | 
				
			||||||
	char digit[5];
 | 
						char digit;
 | 
				
			||||||
	while(fgets(str,100,stdin)){
 | 
						while(fgets(str,100,stdin)){
 | 
				
			||||||
	    if(str[0]=='\n'){
 | 
						    if(str[0]=='\n'){
 | 
				
			||||||
	        break;
 | 
						        break;
 | 
				
			||||||
	    }
 | 
						    }
 | 
				
			||||||
	    sscanf(str,"%s %[^\t\n]",digit,name);
 | 
						    sscanf(str,"%c %[^\t\n]",&digit,name);
 | 
				
			||||||
	    if(isalpha(digit[0])!=0){
 | 
						    if(isalpha(digit)!=0){
 | 
				
			||||||
	      if(c==0){
 | 
						      if(c==0){
 | 
				
			||||||
          	printf("Nepodarilo nacitat nic\n");
 | 
					          	printf("Nepodarilo nacitat nic\n");
 | 
				
			||||||
            return 0;
 | 
					            return 0;
 | 
				
			||||||
          } 
 | 
					          } 
 | 
				
			||||||
          break;
 | 
					 | 
				
			||||||
	    }
 | 
						    }
 | 
				
			||||||
	    int score = atoi(digit);
 | 
						    int score = digit-48>=0?digit-48:0;
 | 
				
			||||||
		PersonList[c].score = score;
 | 
							PersonList[c].score = score;
 | 
				
			||||||
	    strcpy(PersonList[c].name ,name);
 | 
						    strcpy(PersonList[c].name ,name);
 | 
				
			||||||
		c++;
 | 
							c++;
 | 
				
			||||||
 | 
							score=0;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
	if(c>2){
 | 
						if(c>=2){
 | 
				
			||||||
	qsort(PersonList,c,sizeof(struct person),comp);
 | 
						qsort(PersonList,c,sizeof(struct person),comp);
 | 
				
			||||||
	int res_strcmp=0;
 | 
						int res_strcmp=0;
 | 
				
			||||||
	int idex = 0;
 | 
						int idex = 0;
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user