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 Jiaxiaoyuan11 @ 2022-07-28 20:52:02
@ruanjingqi 真标准
by _Blizzard_ @ 2022-08-06 21:37:53
@jiaxiaoyuan11 你这个的话,样例能过,但是提交还是会0分。第8行要改成for(i=strlen(a)-2;i>=0;i--)
by yeqiwei @ 2022-08-23 12:21:46
@Jiaxiaoyuan11 或者这样:
#include<iostream>
#include<string>
using namespace std;
int main()
{
string s;
int i;
cin>>s;
int len=s.length();
for(i=len-1;i>=0;i--)
cout<<s[i];
return 0;
}
by Jiaxiaoyuan11 @ 2022-08-24 17:48:34
@yeqiwei 哦,好的谢谢
by Zhangyuyang123 @ 2022-08-26 23:08:59
用string就可以了