uz by to mohlo fungovat stale bez osetrenia vstupu 3
This commit is contained in:
		
							parent
							
								
									7d350360ac
								
							
						
					
					
						commit
						3289a922e4
					
				@ -14,11 +14,12 @@ int main() {
 | 
			
		||||
	int user_counter = 1;
 | 
			
		||||
	int max_number_user_pair[2] = {0,0};
 | 
			
		||||
	int starting_index = 0;
 | 
			
		||||
	int last = 0;
 | 
			
		||||
	while(starting_index<string_index) {
 | 
			
		||||
		while (loading_string[iterating_index] != ' ' && loading_string[iterating_index] != '\0' && loading_string[iterating_index] != '\n') {
 | 
			
		||||
			iterating_index++;
 | 
			
		||||
		}
 | 
			
		||||
		if (loading_string[iterating_index] == '\n') iterating_index += 2;
 | 
			
		||||
		if (loading_string[iterating_index] == '\n') last=1;
 | 
			
		||||
		int number_size = iterating_index-starting_index;
 | 
			
		||||
		int current_number = 0;
 | 
			
		||||
		for (int l=0;l<number_size;l++) {
 | 
			
		||||
@ -36,6 +37,7 @@ int main() {
 | 
			
		||||
		user_counter++;
 | 
			
		||||
		iterating_index++;
 | 
			
		||||
		starting_index = iterating_index;
 | 
			
		||||
		if (last) starting_index = string_index+1;
 | 
			
		||||
	}
 | 
			
		||||
	printf("Výherca je súťažiaci %d ktorý vypil %d pohárov.\n",max_number_user_pair[1], max_number_user_pair[0]);
 | 
			
		||||
	return 0; 
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user