Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
83775 sh25_huangse 数字反转 C++ 解答错误 0 MS 252 KB 539 2026-02-01 21:18:02

Tests(0/10):


#include<iostream> #include<cmath> using namespace std; int main(){ long n; int s[50]; int x=0; bool b=true; while(cin>>n){ if(n<0){ cout<<"-"; n=abs(n); } while(n>0){ s[x]=n%10; ++x; n=n/10; } for(int i=0;i<x;++i){ if(s[i]==0) b=false; if(b!=false){ cout<<s[i]; } } cout<<endl; x=0; b=true; } return 0; }


测评信息: