Изменить 'du4/program.c'

vv
This commit is contained in:
Oleksandr Hryshchenko 2021-04-01 13:20:25 +00:00
parent 67e9fdfc10
commit 485f9e1056

View File

@ -15,17 +15,19 @@ int main(){
char* ptr; char* ptr;
bool equals = false; bool equals = false;
for(int i = 0; fgets(input, 100, stdin); i++){ for(int i = 0; fgets(input, 100, stdin) != NULL; i++){
counter = 0; counter = 0;
operation = 0; operation = 0;
equals = false; equals = false;
memset(number1, '\0', 25); memset(number1, '\0', 25);
memset(number2, '\0', 25); memset(number2, '\0', 25);
while (input[counter] != '\0'){ while (input[counter] != '\0' && input[counter] != '\n'){
symbol = input[counter++]; symbol = input[counter++];
while(isspace(symbol)) while(isspace(symbol))
symbol = input[counter++]; symbol = input[counter++];
if(symbol == '\0' || symbol == '\n')
break;
switch(symbol){ switch(symbol){
case '+': case '+':
operation = 1; operation = 1;