Nyist 96 n-1 digits

Source: Internet
Author: User

Question 96
Question information running result this question ranking discussion area n-1 digits
Time Limit: 3000 MS | memory limit: 65535 KB
Difficulty: 1
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
4
1023
5923
923
1000 sample output
23
923
23
0

 

// Use a string:
# Include <iostream>
# Include <cstring>
Using namespace STD;
Int main ()
{Char s [10];
Int I, N, K, M, J;
Cin> m;
While (M --)
{
Cin> S;
K = strlen (s );
For (I = 1; I <K; I ++)
If (s [I]! = '0') break;
If (I = k) {cout <0 <Endl; continue ;}

For (j = I; j <K; j ++)
Cout <s [J];
Cout <Endl;
}
Return 0;
}


# Include <stdio. h>
Int main ()
{
Int N;
Int m;
Scanf ("% d", & N );
While (n --)
{
Scanf ("% d", & M );
If (M = 1000000 | M = 100000 | M = 10000 | M = 1000 | M = 100 | M = 10)
M = 0;
If (M> 10 & M <100) M % = 10;
Else if (M <1000) M % = 100;
Else if (M <10000) M % = 1000;
Else if (M <100000) M % = 10000;
Else if (M <1000000) M % = 100000;
Printf ("% d \ n", M );
}
Return 0;
}

 

 

 

 

 

 

# Include <cstdio>
Int main ()
{
Int n, m;
Scanf ("% d", & N );
While (n --)

{
Scanf ("\ n % * C % d", & M); // remove the first entry from the input content. If the input is 845, 45 is placed in M.
Printf ("% d \ n", M );

}
}

 

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.