#include<bits/stdc++.h>
using namespace std;
int main()
{
int a,b,c;
cin>>a;
b=a%1000;
c=b%100;
cout<<c%10<<c/10<<b/100<<a/1000;
}
这个用了很多方法都交不上,麻烦帮忙看看错误出在哪里,非常感谢
#include<bits/stdc++.h>
using namespace std;
int main()
{
int a,b,c;
cin>>a;
b=a%1000;
c=b%100;
cout<<c%10<<c/10<<b/100<<a/1000;
}
int main()
{
int n,a,b,c,d;
cin>>n;
a=n%10;
b=n/10%10;
c=n/100%10;
d=n/1000;
cout<<a*1000+b*100+c*10+d;
return 0;
}