fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int n;
  6. char c;
  7. cin>>n;
  8.  
  9. for(int i=0;i<n;i++){
  10. cin>>c;
  11.  
  12. if(c=='J')
  13. cout<<'O';
  14. else if(c=='O')
  15. cout<<"I";
  16. else
  17. cout<<"J";
  18.  
  19. }
  20. return 0;
  21. }
Success #stdin #stdout 0.01s 5272KB
stdin
10
JOIOOJOOOJ
stdout
OIJIIOIIIO