#include <stdio.h>
main(void){ printf("\n***********");
for(int a=1 ; a <= 8 ; ++a)
printf("\n* *");
printf("\n***********\n");
getchar();
}帮忙看看出了什么问题
main(void){ printf("\n***********");
for(int a=1 ; a <= 8 ; ++a)
printf("\n* *");
printf("\n***********\n");
getchar();
}帮忙看看出了什么问题
#include <stdio.h>
main(void){
int a;
printf("\n***********");
for(a=1 ; a <= 8 ; ++a)
printf("\n* *");
printf("\n***********\n");
getchar();}
就可以执行了 不然前面的代码就老提示错误
你前面的代码提示什么错误信息?
error C2143: syntax error : missing ';' before 'type'
error C2143: syntax error : missing ')' before 'type'
error C2143: syntax error : missing ';' before 'type'
error C2065: 'a' : undeclared identifier
warning C4552: '<=' : operator has no effect; expected operator with side-effect
: error C2059: syntax error : ')'
: error C2146: syntax error : missing ';' before identifier 'printf'
c 支持 int i; for(i=1;.....)从编译器上来说(vc) 源文件 后缀为.c支持 int i; for(i=1;.....)
源文件后缀名是.cpp 两者都可以所以lz的源文件后缀是.c的,按c的写法就可以了,没错误,不用怀疑。