#include <iostream> using namespace std; int main(){ int a;//四位数字 cin>>a; int gw,sw,bw,qw; gw=a%10; sw=a%100/10; bw=a/100%10; qw=a/1000; gw=(gw+5)%10; sw=(sw+5)%10; bw=(bw+5)%10; qw=(qw+5)%10; cout<<qw<<" "<<bw<<" "<<sw<<" "<<gw<<endl; cout<<gw*1000+sw*100+bw*10+qw; return 0; }