Liu_Chu_yao @ 2024-11-26 13:03:51
#pragma warning(disable:4996)
#include<stdio.h>
#include<string.h>
int main()
{
char a[15];
scanf("%s", a);
int L = strlen(a);
for (int i = L - 1; a[i] == '0'&&i>=0; L--,i--);
if (a[0] != '-')
{
for (int i = L - 1; i >= 0; i--)
{
printf("%c", a[i]);
}
}
else
{
printf("%c", a[0]);
for (int i = L - 1; i >0; i--)
{
printf("%c", a[i]);
}
}
return 0;
}
这是我的代码,用了一个字符串,但第一个测试点没过,求劳解答!!
by xiao999yao @ 2024-11-26 13:07:31
@Liu_Chu_yao 你加 #pragma 能过洛谷的编译?(验证码tpng祭
by coding_sealion @ 2024-11-26 17:43:41
你输入0啥都没有,你特判一下
by Liu_Chu_yao @ 2024-11-26 21:38:19
@coding_sealion 谢谢!已经AC了,非常感谢!