***第6点没过,请神犇纠错,蒟蒻感激不已!!!***

评测结果


编译成功

测试数据 #0: Accepted, time = 15 ms, mem = 560 KiB, score = 10

测试数据 #1: Accepted, time = 0 ms, mem = 560 KiB, score = 10

测试数据 #2: Accepted, time = 0 ms, mem = 560 KiB, score = 10

测试数据 #3: Accepted, time = 0 ms, mem = 564 KiB, score = 10

测试数据 #4: Accepted, time = 0 ms, mem = 560 KiB, score = 10

测试数据 #5: Accepted, time = 0 ms, mem = 560 KiB, score = 10

测试数据 #6: WrongAnswer, time = 0 ms, mem = 560 KiB, score = 0

测试数据 #7: Accepted, time = 15 ms, mem = 560 KiB, score = 10

测试数据 #8: Accepted, time = 0 ms, mem = 560 KiB, score = 10

测试数据 #9: Accepted, time = 0 ms, mem = 560 KiB, score = 10

WrongAnswer, time = 30 ms, mem = 564 KiB, score = 90


代码

#include<iostream>
#include<cstring>
using namespace std;
char s[16];
int num=0;//正数
long long ans;
int main()
{
  cin>>s;
  if(s[0]=='-')
    num=1;//负数
  int len=strlen(s);
  for(int i=len-1-num;i>=0+num;i--)
  {
    ans*=10;
    ans+=s[i]-'0';
  }
  if(num)
    cout<<'-';
  cout<<ans;
  return 0;
}

1 条评论

  • @ 2016-11-08 22:48:32
    
    评测结果
    
    
    编译成功
    
    测试数据 #0: Accepted, time = 0 ms, mem = 560 KiB, score = 10
    
    测试数据 #1: Accepted, time = 0 ms, mem = 560 KiB, score = 10
    
    测试数据 #2: Accepted, time = 0 ms, mem = 560 KiB, score = 10
    
    测试数据 #3: Accepted, time = 0 ms, mem = 560 KiB, score = 10
    
    测试数据 #4: Accepted, time = 0 ms, mem = 560 KiB, score = 10
    
    测试数据 #5: Accepted, time = 0 ms, mem = 556 KiB, score = 10
    
    测试数据 #6: Accepted, time = 0 ms, mem = 560 KiB, score = 10
    
    测试数据 #7: Accepted, time = 0 ms, mem = 560 KiB, score = 10
    
    测试数据 #8: Accepted, time = 0 ms, mem = 560 KiB, score = 10
    
    测试数据 #9: Accepted, time = 0 ms, mem = 560 KiB, score = 10
    
    Accepted, time = 0 ms, mem = 560 KiB, score = 100
    
    
    代码
    
    #include<iostream>
    #include<cstring>
    using namespace std;
    char s[16];
    int num=0;//正数
    long long ans;
    int main()
    {
      cin>>s;
      if(s[0]=='-')
        num=1;//负数
      int len=strlen(s);
      for(int i=len-1;i>=0+num;i--)
      {
        ans*=10;
        ans+=s[i]-'0';
      }
      if(num)
        cout<<'-';
      cout<<ans;
      return 0;
    }
    
    

    原先小题大做了……

  • 1

信息

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