zqy_555 @ 2023-11-14 17:29:07
#include <stdio.h>
#include <string.h>
int main() {
char a[10];
gets(a);
for(int i=strlen(a)-1;i>=0;i--){
printf("%c",a[i]);
}
return 0;
}
by sisi_ @ 2023-11-14 17:45:06
gets 把回车也读入了,多输出了一个回车
Wrong Answer.wrong answer On line 1 column 1, read (ASCII 13), expected 5.
@zqy_555
by zqy_555 @ 2023-11-14 18:54:54
@sisi8849 可是,gets函数会自动把\n替换为\0
by zqy_555 @ 2023-11-14 18:58:59
@sisi8849 你看输出也没有回车啊
by zqy_555 @ 2023-11-14 19:00:07
@zqy_555 !
by zqy_555 @ 2023-11-14 19:23:52
@sisi8849 我擦,原来是不支持gets函数,gets函数有危险,我们学校的oj平台也不让用。
by FangJinchen2022 @ 2023-11-26 15:37:11
@zqy_555