제출 #16952

#제출 시각아이디문제언어결과실행 시간메모리
16952taehoon1018MathWorlds (YDX13_mathworlds)C++98
컴파일 에러
0 ms0 KiB


int main(void)
{
	double long x, y, z, count = 0;
	char ch;

	scanf("%d%d%d", &x, &y, &z);

	if (x + y == z)
	{
		count++;
		ch = '+';
	}
	if (x - y == z)
	{
		ch = '-';
		count++;
	}
	if (x*y == z)
	{
		ch = '*';
		count++;
	}
	if (x / (float)y == z)
	{
		count++;
		ch = '/';
	}

	if (count == 1)
		printf("%c", ch);
	else
		printf("Invalid");

}

컴파일 시 표준 에러 (stderr) 메시지

D.cpp: In function ‘int main()’:
D.cpp:8:28: error: ‘scanf’ was not declared in this scope
  scanf("%d%d%d", &x, &y, &z);
                            ^
D.cpp:32:18: error: ‘printf’ was not declared in this scope
   printf("%c", ch);
                  ^
D.cpp:34:19: error: ‘printf’ was not declared in this scope
   printf("Invalid");
                   ^