标签:class div string tab ble int table har for ios name
已知w是一个大于10但不大于1000000的无符号整数,若w是n(n≥2)位的整数,则求出w的后n-1位的数。
4 1023 5923 923 1000
23 923 23 0
#include<iostream>
#include<cstring>
#include<string>
using
namespace std;
int main(int argc, char* argv[])
{
int
m;
cin>>m;
while(m--)
{
int
w,i,a[6];
cin>>w;
a[0]=w/100000;
a[1]=(w-100000*a[0])/10000;
a[2]=(w-100000*a[0]-10000*a[1])/1000;
a[3]=(w-100000*a[0]-10000*a[1]-1000*a[2])/100;
a[4]=(w-100000*a[0]-10000*a[1]-1000*a[2]-100*a[3])/10;
a[5]=w-100000*a[0]-10000*a[1]-1000*a[2]-100*a[3]-10*a[4];
for(i=0;i<6;i++)
if(a[i]!=0)
break;
i=i+1;
while(a[i]==0)
i++;
if(i<6)
{
for(;i<6;i++)
cout<<a[i];
cout<<endl;
}
else
{
cout<<0<<endl;
}
}
return
0;
}
标签:class div string tab ble int table har for ios name
原文地址:http://www.cnblogs.com/52Cyan/p/3695623.html