Initialization

This commit is contained in:
Kozar 2024-03-05 10:48:49 +01:00
parent af9736b2e7
commit b2b446cdf2

View File

@ -11,14 +11,16 @@ int main() {
double result = 0.0;
while (count < SIZE) {
if (scanf("%lf", &input) != 1) {
if (scanf("%lf", &input) != 1 && (scanf("%c", &input) != 1 || input != 'x')) {
printf("Nepodarilo sa nacitat polynom na %d mieste.\n", count + 1);
break;
}
if (input == 'x') {
break;
}
coefs[count] = input;
count++;
}
coefs[count] = input;