fork(2) download
  1. #include <iostream>
  2. #include <stdio.h>
  3. int main(void){
  4. char a,b;
  5. while(true)
  6. {
  7. if(std::cin.peek()==EOF) break;
  8. scanf("%c",&a);
  9. if(std::cin.peek()==EOF)
  10. {
  11. printf("%c",a);
  12. break;
  13. }
  14. scanf("%c",&b);
  15. (b=='\n'||a=='\n')?printf("%c%c",a,b):printf("%c%c",b,a);
  16. }
  17. }
  18.  
Success #stdin #stdout 0s 16064KB
stdin
LA AAMK TOA
OBEL K IOLELK
NEGIAMW W REJS IILHGT
a
stdout
ALA MA KOTA
BOLEK I LOLEK
ENIGMA W WERSJI LIGHT
a