| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 147033 | 王晏林 | 回文数 | C++ | Compile Error | 0 MS | 0 KB | 509 | 2026-02-02 14:46:05 |
#include<iostream> using namespace std; int main(){ intx,y; separate(int*data,intn) { inti,j; y=0; while(n!=0) { *(data+y)=n%10;n=n/10;y++; } *(data+y)='\0'; for(i=0,j=y-1;i<=j;i++,j--) { if(*(data+i)!=*(data+j)){ printf("%d不是回文!!!\n",x);break; } } if(i ==y-1) printf("是回文数"); } voidmain() { inta[99]; printf("请输入一个正整数:"); scanf("%d",&x); separate(a,x); } return 0; }
Main.cc: In function 'int main()':
Main.cc:4:1: error: 'intx' was not declared in this scope
intx,y;
^
Main.cc:4:6: error: 'y' was not declared in this scope
intx,y;
^
Main.cc:5:10: error: expected primary-expression before 'int'
separate(int*data,intn)
^
Main.cc:5:19: error: 'intn' was not declared in this scope
separate(int*data,intn)
^
Main.cc:5:23: error: 'separate' was not declared in this scope
separate(int*data,intn)
^
Main.cc:22:10: error: 'voidmain' was not declared in this scope
voidmain()
^