25- -25-n-1 digits of the introductory language

Source: Internet
Author: User

Title address: http://acm.nyist.edu.cn/JudgeOnline/problem.php?pid=96?? Description
knownWis a greater thanTenbut not greater than1000000An unsigned integer, ifWis aN (n≥2)The integer of the bit, then find outWThe Postn-1the number of bits.

input
First actMthat represents the number of test data groups.
NextMrow, each row contains one test data.
Output
OutputMrow, the corresponding row for each behaviorn-1Number of digits (Ignore prefix0). If except for the highest bit, the remaining bits are0, the output0.
Sample Input
4
1023
5923
923
1000
Sample Output
23
923
at0?? Code:?#include <stdio.h>

//process and Print results
Static void Handlerdata (int NUM);

int Main ()
{
??? int Readlen = 0;
??? scanf("%d", &readlen);
??? GetChar();
???
??? while (readlen>0)
??? {
??????? int num = 0;
??????? scanf("%d", &num);
??????? GetChar();
??????? Handlerdata(num);
???????
??????? --readlen;
??? }
???
??? return 0;}
//process and Print results
Static void Handlerdata (int num)
{
??? if (num <= Ten)
??? {
??????? return;
??? }
???
??? int index = 1;
??? int result = 0;
???
??? Do
??? {
??????? //gets the current last one
??????? int k = num% Ten;
??????? //10in-Process rounding
??????? Result + = k * INDEX;
??????? //10Rounding-Next Cycle Preparation
??????? index*=Ten;
??????? //Remove the bottom
??????? num = num/Ten;
??? } while (num > Ten);
???
??? printf("%d\n", result);}?

25- -25-n-1 digits of the introductory language

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.