小火车污污污 @ 2017-05-11 21:14:28
我的思想是先取这个数的某位数的余,然后减去下一个数的余,再除以这个数量级得到这个位的数,最后相加。。
#include<iostream>
using namespace std;
int main()
{
int a,b,c,d,e,f,g,h,i,j,sum;
cin>>sum;
a=(sum%10000000000-sum%1000000000)/1000000000;
b=(sum%1000000000-sum%100000000)/100000000;
c=(sum%100000000-sum%10000000)/10000000;
d=(sum%10000000-sum%1000000)/1000000;
e=(sum%1000000-sum%100000)/100000;
f=(sum%100000-sum%10000)/10000;
g=(sum%10000-sum%1000)/1000;
h=(sum%1000-sum%100)/100;
i=(sum%100-sum%10)/10;
j=sum%10;
sum=a+b*10+c*100+d*1000+e*10000+f*100000+g*1000000+h*10000000+i*100000000+j*1000000000;
while(sum%10==0)
{
sum/10;
}
cout<<sum;
return 0;
}
那么问题就来了先不管编的对不对,我的思想好像没错啊。 如果有什么智障错误千万千万不要喷!
by mengbierr @ 2017-05-11 21:21:44
...
by 小火车污污污 @ 2017-05-11 21:22:11
@无敌 ......?
by mengbierr @ 2017-05-11 21:24:02
看着好暴力...还有sum/10是什么`
by mengbierr @ 2017-05-11 21:30:49
思路还可以,只是要开long long
by mengbierr @ 2017-05-11 21:31:04
@小火车污污污
by zhengrunzhe @ 2017-05-11 22:11:25
……………为什么不直接开字符串
by 小火车污污污 @ 2017-05-12 19:11:42
@无敌 谢谢,抱歉隔了一天才回复
by 新的开始 @ 2017-05-23 20:09:28
。。。。。我现在是蒟蒻!开了个新号!