zzxzzx_ @ 2024-11-10 12:22:05
#include <stdio.h>
#include <string.h>
char str[15];
int main()
{
int len,i,test=0;
scanf("%s",str);
len=strlen(str);
i=len-1;
if(str[0]=='-')
{
printf("-");
while(i>0)
{
if(str[i]!='0')
{
test=1;
printf("%c",str[i]);
}
else if(str[i]!='0' || test==1)
printf("%c",str[i]);
i--;
}
}
else
{
while(i>=0)
{
if(str[i]!='0')
{
test=1;
printf("%c",str[i]);
}
else if(str[i]!='0' || test==1)
printf("%c",str[i]);
i--;
}
}
return 0;
}
by Liuyuze1 @ 2024-11-11 13:50:22
JHGS,I'HRE
by takej233 @ 2024-11-14 13:06:56
@zzxzzx_你好会不会是输入0的时候不成立,刚才做这道题的时候和你一样100分但不ac 而我就是因为忘记判断当输入0的时候 ,你可以试试看输入0结果是不是0
by kkk_is_a_big_big_SB @ 2024-12-07 14:14:23
@takej233我也是