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 Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

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

Learn more >

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.