我写的:
#include "stdio.h"
main()
{
int i=0;
printf("1+1=%d\n",i);
printf("hello world!\n");
printf("北京欢迎您!\n);
getchar();
}
报错:
File "/code/code.py",line 4
int i=0;
SyntaxError:invalid syntax
求如何解决!
用的C,报错却是python?
我不理解,但我大受震撼。
#include "stdio.h"
int main() //man函数要用关键字表示其有返回值,不想要有返回值可以使用 void main()
{
int i=0;
printf("1+1=%d\n",i);
printf("hello world!\n");
printf("北京欢迎您!\n");
getchar();
return 0;
}
你的编译器有问题
真是笑死了,你把C语言代码放到py文件里?
#include <stdio.h>
void main()
{
int i=0;
printf("1+1=%d\n",i);
printf("hello world!\n");
printf("北京欢迎您!\n");
getchar();
}