Advertisement
a53

ParitateSiruri

a53
Oct 15th, 2018
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. #include <fstream>
  2. #include <cstring>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int k;
  8. ifstream f("paritatesiruri.in");
  9. ofstream g("paritatesiruri.out");
  10. f>>k;
  11. char s[10001];
  12. while(k--)
  13. {
  14. f>>s;
  15. int n=strlen(s);
  16. for(int i=1;i<n;i+=2)
  17. g<<s[i];
  18. g<<' ';
  19. for(int i=0;i<n;i+=2)
  20. g<<s[i];
  21. g<<'\n';
  22. }
  23. f.close();
  24. g.close();
  25. return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement