[已解决]

如题。
~~~
编译成功

测试数据 #0: Accepted, time = 15 ms, mem = 576 KiB, score = 10
测试数据 #1: WrongAnswer, time = 0 ms, mem = 580 KiB, score = 0
测试数据 #2: Accepted, time = 0 ms, mem = 576 KiB, score = 10
测试数据 #3: Accepted, time = 15 ms, mem = 580 KiB, score = 10
测试数据 #4: Accepted, time = 15 ms, mem = 576 KiB, score = 10
测试数据 #5: Accepted, time = 15 ms, mem = 576 KiB, score = 10
测试数据 #6: Accepted, time = 0 ms, mem = 576 KiB, score = 10
测试数据 #7: Accepted, time = 0 ms, mem = 572 KiB, score = 10
测试数据 #8: Accepted, time = 0 ms, mem = 576 KiB, score = 10
测试数据 #9: WrongAnswer, time = 0 ms, mem = 576 KiB, score = 0
WrongAnswer, time = 60 ms, mem = 580 KiB, score = 80
~~~

#include<iostream>
using namespace std;
int h,t;string s;
int main(){
    cin>>s;
    t=s.length();
    if(s[0]=='-'){
        cout<<'-';h++;
    }
    for(int i=t-1;i>h;i++){
        if(s[i]=='0') t--;
        else break;
    }
    for(int i=t-1;i>=h;i--) cout<<s[i];
}

3 条评论

  • @ 2017-01-12 17:27:29

    #include<stdio.h>

    int main()
    {
    int n,ans=0;
    scanf("%d",&n);
    while(n)
    {
    ans*=10;
    ans+=n%10;
    n/=10;
    }
    printf("%d",ans);
    return 0;
    }

  • @ 2016-11-08 21:45:24

    ……谢谢……居然过了8个点……
    已对。

    • @ 2016-11-08 21:48:03

      因为这八个点的数后面的零只有一个,所以你只清掉一个零也对

  • @ 2016-11-08 21:43:29



    for(int i=t-1;i>h;i++){

    改为

    for(int i=t-1;i>h;i--){

  • 1

信息

ID
1756
难度
4
分类
模拟 点击显示
标签
递交数
3911
已通过
1766
通过率
45%
被复制
22
上传者