#include <string.h>
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
char str1[10];
char str2[10];
char str3[10];
int num1, res;
char *ps1 = str1;
char *ps2 = str2;
char *ps3 = str3;
while (1)
{
printf("0P #1: ");
scanf("%s", str1);
if (ps1[0] == '0')
{
return 0;
}
printf("OPER: ");
scanf("%s", str2);
printf("OP #2: ");
scanf("%s", str3);
if (str2[0] == '@' && str2[1] == '\0')
{
strcat(str1, str3);
num1 = atoi(str1);
res = num1 + 1;
printf("Result: %d\n", res);
}
else if (str2[0] == '#' && str2[1] == '\0')
{
strcat(str3, str1);
num1 = atoi(str3);
res = num1 - 1;
printf("result : %d\n", res);
}
else
return 0;
}
return 0;
}
위 문제에 맞춰 제가 코드를 짜보았는데요 틀린 부분이 있으면 말씀햊해시고 혹시 잘 짜실 수 있으면 ㅂㅜ탁드립니다