ASD
This commit is contained in:
		
							parent
							
								
									4702d0e22e
								
							
						
					
					
						commit
						d42b2fd995
					
				
							
								
								
									
										
											BIN
										
									
								
								du2/program
									
									
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								du2/program
									
									
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							| @ -3,24 +3,23 @@ | |||||||
| 
 | 
 | ||||||
| int main(){ | int main(){ | ||||||
| 	int results[VELKOST_POLA]; | 	int results[VELKOST_POLA]; | ||||||
| 	int max; | 	int max = 0; | ||||||
| 	int i = 0; | 	int i = 0; | ||||||
| 	while(1){ | 	while(1){ | ||||||
| 		int value = 0; | 		int value = 0; | ||||||
| 		int r = scanf("%d",&value); | 		int r = scanf("%d",&value); | ||||||
| 		if (r == 1){ | 		if (r == 1){ | ||||||
| 			results[i] = value; | 			results[i] = value; | ||||||
| 			max = results[0]; |  | ||||||
| 			if(max < results[i]){ | 			if(max < results[i]){ | ||||||
| 				printf("Súťažiaci č. %d vypil %d pohárov.\n",i+1,results[i]); | 				//printf("Súťažiaci č. %d vypil %d pohárov.\n",i+1,results[i]);
 | ||||||
|  | 				max = results[i]; | ||||||
| 			} | 			} | ||||||
| 			printf("Súťažiaci č. %d vypil %d pohárov.\n",i+1,results[i]); | 			printf("Súťažiaci č. %d vypil %d pohárov.\n",i+1,results[i]); | ||||||
| 			i++; | 			i++; | ||||||
| 		}else if(i == 0){ | 		}else if(i == 0){ | ||||||
| 			printf("Chyba: Málo platných hodnôt.\n"); | 			printf("Chyba: Málo platných hodnôt.\n"); | ||||||
| 		}else{ | 		}else{ | ||||||
| 			/*first = i;
 | 			printf("Výherca je súťažiaci %d ktorý vypil %d pohárov.\n",i,max); | ||||||
| 			printf("Výherca je súťažiaci %d ktorý vypil %d pohárov.\n",i,max);*/ |  | ||||||
| 			break; | 			break; | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user