Digital flip
Topic link: digital flip
Title description
Problem solving ideas
Determine whether the number is negative.
Remove leading 0 00。
code
#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
int ok;
char c[11];
int main()
{
cin>>c;
if(c[0]=='-')
{
printf("-");
int i=strlen(c)-1;
while(c[i]=='0') i--;
for(;i>0;i--)
cout<<c[i];
}
else
{
int i=strlen(c)-1;
while(c[i]=='0') i--;
for(;i>=0;i--)
cout<<c[i];
}
}