大佬们,请问一下为什么是五个WA

P5705 【深基2.例7】数字反转

所以你的md怎么这么奇怪
by Vsinger_洛天依 @ 2023-10-29 15:02:55


用得着这么繁? ```cpp #include <bits/stdc++.h> using namespace std; int main(){ char a,b,c,d; scanf("%c%c%c.%c",&a,&b,&c,&d); printf("%c.%c%c%c",d,c,b,a); return 0; } ```
by cly312 @ 2023-10-29 15:05:48


字符串秒了
by Vsinger_洛天依 @ 2023-10-29 15:06:22


? ```cpp #include <bits/stdc++.h> using namespace std; string a; int main() { cin>>a; for(int i=a.length()-1;i>=0;i--)cout<<a[i]; return 0; } ```
by 初星逝者 @ 2023-10-29 15:39:24


*很简单* **string + reverse**
by Vincent615 @ 2023-10-29 15:42:26


直接用字符串存就行了: ```cpp #include<bits/stdc++.h> using namespace std; int mian() { string s; cin>>s; for(int i=s.size()-1;i>=0;i--) { cout<<s[i]; } return 0; } ```
by wzh_45 @ 2023-11-04 08:46:57


@[Vincent615](/user/969673) ```cpp reverse ``` 函数代码: ```cpp #include<bits/stdc++.h> using namespace std; int main() { string s; cin>>s; reverse(s.begin(),s.end()); cout<<s; return 0; } ```
by wzh_45 @ 2023-11-04 08:55:01


@[wzh_45](/user/1112980) 是的,没错
by Vincent615 @ 2023-11-05 12:54:53


|