9 条题解
-
0
Guest
- 1
信息
- ID
- 17
- 时间
- 1000ms
- 内存
- 256MiB
- 难度
- 1
- 标签
- 递交数
- 180
- 已通过
- 120
- 上传者
笑点解析,reverse
#include<bits/stdc++.h>
using namespace std;
int main(){
string str;
cin>>str;
reverse(str.begin(),str.end());
cout<<str;
return 0;
}
用 char
少走 INT_MAX
年弯路。
#include<bits/stdc++.h>
using namespace std;
int main(){
char a,b,c,d;
cin>>a>>b>>c>>d;
cout<<d<<c<<b<<a;
return 0;
}
如绞尽脑汁写代码的呕吐感 #include<bits/stdc++.h> using namespace std; int main() { int w,s,a,b,c,d; cin>>w; a=w/1000; b=w/100%10; c=w/10%10; d=w%10; s=d1000+c100+b*10+a; cout<<s; return 0; }
#include<iostream> using namespace std; int main() { int w,b,c,d,e,ans=0; cin>>w; b=w/100/10; c=w/100%10; d=w%100/10; e=w%10; if(e0,d0)cout<<c<<b; else cout<<e<<d<<c<<b; return 0; }
用char不是更快吗 #include<bits/stdc++.h> using namespace std; int main() { char a,b,c,d; cin>>a>>b>>c>>d; cout<<d<<c<<b<<a<<endl; return 0; }
注册一个 PYYG 通用账户,您就可以在我们提供的所有在线评测服务上提交代码、参与讨论。