哪里错了

P1307 [NOIP2011 普及组] 数字反转

imbecile @ 2020-05-17 18:37:50

#include<bits/stdc++.h>
using namespace std;
int main()
{
    string s;
    bool y=false;
    cin>>s;
    int n;
    n=s.size();
    if(s[0]=='-') cout<<"-";
    for(int i=n-1;i>=0;i--)
    {
        if(s[i]!='-'&&s[i]!='0') cout<<s[i]-48;
    }
}

by SIXIANG32 @ 2020-05-17 18:54:16

@zengxiangtuo 801就hack


by imbecile @ 2020-05-17 18:55:39

@SIXIANG 了解!


上一页 |