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.

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


Related Article

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.