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

Source: Internet
Author: User

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.

Input
The first act is M, which indicates the number of test data groups.
In the next M rows, each row contains a test data.
Output
Output 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
4102359239231000
Sample output
23923230
My program:

# 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. }

Related Keywords:
Related Article E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth \$300-1200 USD