It is known that w is an unsigned integer greater than 10 but not greater than 1000000. If w is an integer n (n ≥ 2), the number of the last n-1 digits of w is obtained ., Known positive integer n greater than 30
Description
It is known that w is an unsigned integer greater than 10 but not greater than 1000000. If w is an integer n (n ≥ 2), the number of the last n-1 digits of w is obtained.
InputThe first act is M, which indicates the number of test data groups.
In the next M rows, each row contains a test data.OutputOutput M rows. Each row corresponds to the n-1 digits of the row (the prefix 0 is ignored ). If all the other bits except the highest bit are 0, the output is 0.Sample Input
4
1023
5923
923
1000
Sample output
23
923
23
0
my programme:
# Include <iostream>
# Include <vector>
# Include <cmath>
Using namespace std;
Int main ()
{
Int m;
Unsigned int w;
Cin> m;
Vector <int> a, B;
For (int I = 0; I <m; I ++)
{
Int x, y = 0;
Int k = 0;
Cin> x;
While (x> 10)
{
Y = y + x % 10 * pow (10, k );
X = x/10;
++ K;
}
A. push_back (y );
}
For (int j = 0; j <m; j ++)
Cout <a [j] <endl;
Return 0;
}
People's programs:
# Include <cstdlio>
int main()
03.{04.int n,m;05.scanf("%d",&n);06.while(n--)07.{08.scanf("\n%*c%d",&m);09.printf("%d\n",m);10.}11.}