Home > Back-end >  According to sprout new oj digital reversal * timeout, how should solve? Help bosses
According to sprout new oj digital reversal * timeout, how should solve? Help bosses

Time:06-03

Oj digital reversal * timeout problem, how to solve,
Title description
Given an integer, please put the number of each bit digital reversal on getting a new number, number of new should also meet the common form of integers, namely unless given the original number is zero, or reverse after the number of new highest number should not be zero, digital requirement for 10 50,
Here is my code:
#include
Int main ()
{
Int flag=0;
Char a [52] [52];
Int I=1; Int z=1;
While ((a [z] [I]=getchar ())!=(EOF)
{
i=i+1;
While ((a [z] [i++]=getchar ())!='\ n');
If (a [z] [1]=='-')
{
I=I - 2;
Printf (" - ");
For (int n=I; N>=2; N -)
{
If (a [z] [n].='0' | | flag==1)
{printf (" % c ", a. [z] [n]); Flag=1; }
The else continue;
}
printf("\n");
}
If (a [z] [1].='-')
{
I=I - 2;
For (int n=I; N>=1; N -)
{
If (a [z] [n].='0' | | flag==1)
{printf (" % c ", a. [z] [n]); Flag=1; }
The else continue;
}
printf("\n");
}
z=z+1;
i=1; }
}

CodePudding user response:

Requirements
Time limit 1 s
16 MB of space limitations

CodePudding user response:

For help, oh bother to answer

CodePudding user response:

I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10581430.html
I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10768339.html
  • Related