|
10鱼币
各位大佬谁能救救萌新,我自己去百度查报错结果答案是变量名未定义,或者拼写错误。可我自己研究了好几个小时实在是找不到解决办法了,谁能详细讲讲这个问题的到底是我哪儿操作错了嘛还是
#define STRING char *
#define IF if(
#define THEN ){
#define ELSE }else{
#define FI ;}
#define WHILE while(
#define DO ){
#define OD ;}
#define INT int
#define BEGIN {
#define END }
INT main()
BEGIN
int i;
printf("请输入您的年龄");
scanf("%d",&i);
IF i<18
THEN
printf("您为满18周岁");
ELSE
printf("您已满18周岁")
FI
return 0;
END
安装最新的 PowerShell,了解新功能和改进!https://aka.ms/PSWindowsPS C:\Users\29395> cd "d:\Gcc\" ; if ($?) { g++ Untitled-11.cpp -o Untitled-11 } ; if ($?) { .\Untitled-11 }Untitled-11.cpp: In function 'int main()':Untitled-11.cpp:15:5: error: 'printf' was not declared in this scope 15 | printf("请输入您的年龄"); | ^~~~~~Untitled-11.cpp:1:1: note: 'printf' is defined in header '<cstdio>'; did you forget to '#include <cstdio>'? +++ |+#include <cstdio> 1 | #define STRING char *Untitled-11.cpp:16:5: error: 'scanf' was not declared in this scope 16 | scanf("%d",&i); | ^~~~~
|
|