fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. char buf[4]={0},ch;
  7. for(int pos=3;cin.get(ch);)
  8. {
  9. if(ch!='\n') buf[pos=(pos+1)&3]=ch;
  10. else
  11. {
  12. for(int i=0;i<4;++i) cout.put(buf[pos=(pos+1)&3]);
  13. cout<<endl;
  14. pos=3;
  15. }
  16. }
  17. return 0;
  18. }
Success #stdin #stdout 0s 2900KB
stdin
Motor Yamaha  2350zl   19.08.1994
jeszcze coś 0003
i 9876
stdout
1994
0003
9876