Jiaxiaoyuan11 @ 2022-07-18 15:48:37
#include<bits/stdc++.h>
using namespace std;
char a[7];
int i;
int main()
{
cin.getline(a,7);
for(i=strlen(a)-1;i>=0;i--)
{
cout<<a[i];
}
return 0;
}
by ShouZheng_Observer @ 2022-07-18 15:53:42
@Jiaxiaoyuan11 肯定0分啊,长度不是5吗
by ShouZheng_Observer @ 2022-07-18 15:54:27
@Jiaxiaoyuan11 把输入时的长度改一下就行了
by Abel_ILmjh @ 2022-07-18 15:55:30
推荐字符串
by 添哥 @ 2022-07-18 15:56:11
@Jiaxiaoyuan11 你这个会把回车读进去,改成:
#include<bits/stdc++.h>
using namespace std;
char a[7];
int i;
int main()
{
cin.getline(a,7);
for(i=strlen(a)-2;i>=0;i--)
{
cout<<a[i];
}
return 0;
}
就可以过了
by Jiaxiaoyuan11 @ 2022-07-18 15:56:40
@PhantomKnight 哦,我试一下
by 添哥 @ 2022-07-18 15:57:48
@PhantomKnight 实测0分
by ShouZheng_Observer @ 2022-07-18 15:58:31
@添哥 阿哲阿哲艹
by ShouZheng_Observer @ 2022-07-18 16:00:23
@添哥
@Jiaxiaoyuan11
啊,应该改成6
by Jiaxiaoyuan11 @ 2022-07-18 16:04:14
@添哥 你这个样例过不去,但是AC了
by Jiaxiaoyuan11 @ 2022-07-18 16:05:46
@PhantomKnight 6是对的