Изменить 'du4/program.c'
vv
This commit is contained in:
parent
67e9fdfc10
commit
485f9e1056
@ -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;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user