12
This commit is contained in:
		
							parent
							
								
									e24c13ad36
								
							
						
					
					
						commit
						2b721e65f5
					
				| @ -11,13 +11,13 @@ int main(){ | ||||
|     float coefficients[50]; | ||||
|     int count = 0; | ||||
| 
 | ||||
|     if(fgets(line, LINE_SIZE, stdin) == NULL) { | ||||
|     if(fgets(line, LINE_SIZE, stdin) == NULL){ | ||||
|       printf("Chyba: Nepodarilo sa nacitat hodnotu x.\n"); | ||||
|       return 1; | ||||
|     } | ||||
|     x = strtof(line, NULL); | ||||
| 
 | ||||
|    while (fgets(line, LINE_SIZE, stdin) != NULL) { | ||||
|    while (fgets(line, LINE_SIZE, stdin) != NULL){ | ||||
|       if (strlen(line) == 1) | ||||
|          break; | ||||
|       float coef = strtof(line, NULL); | ||||
| @ -30,7 +30,7 @@ int main(){ | ||||
|     } | ||||
| 
 | ||||
|     float result = coefficients[0]; | ||||
|     for (int i = 1; i < count; i++) { | ||||
|     for (int i = 1; i < count; i++){ | ||||
|         result = result * x + coefficients[i]; | ||||
|     } | ||||
| 
 | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user