Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
29728 | 惠子铭 | 数字反转 | C++ | Accepted | 0 MS | 180 KB | 416 | 2023-11-02 18:57:42 |
#include<stdio.h> #include<string.h> int main() { int len=0,i; char a[13]; gets(a); len=strlen(a); int top; top=len-1; while(a[top]=='0') top--; if(a[0]=='-') { printf("-"); for(i=top;i>0;i--) printf("%c",a[i]); } else { for(i=top;i>=0;i--) printf("%c",a[i]); } return 0; }