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