bad_bad @ 2024-11-10 11:50:06
#include <stdio.h>
#include <string.h>
int main()
{
char c[6];
gets(c);
int i;
for (i = strlen(c)-1; i>=0; i--)
{
printf("%c", c[i]);
}
return 0;
}
by pika_ @ 2024-11-10 11:58:03
把
gets(c);
换成
scanf("%s",c);
就行了
by laialaodi @ 2024-11-10 11:59:17
@bad_bad 把gets换成scanf试试
by mannnnnnnnnnnnnnnnn @ 2024-11-10 12:01:12
emm...
gets()不稳定,最好用scanf()
=)
by jw19521 @ 2024-12-14 17:23:04
@pika_@pika_这两个有什么区别吗,为什么我做题有时候用能通过有时候不可以