Advertisement
Guest User

Untitled

a guest
Dec 8th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. #include <string>
  2. #include <iostream>
  3. #include <fstream>
  4.  
  5. using namespace std;
  6.  
  7. const int wide = 25;
  8. const int tall = 6;
  9.  
  10. int main() {
  11. std::fstream in2("input.in", std::fstream::in);
  12. string in;
  13. in2 >> in;
  14.  
  15. int no_layers = in.size() / (wide * tall);
  16.  
  17. string res(wide * tall, '2');
  18. for (int pos = 0; pos < wide * tall; ++pos) {
  19. int cur_layer = 0;
  20.  
  21. while (1)
  22. {
  23. if (in[cur_layer * wide * tall + pos] != '2')
  24. {
  25. res[pos] = in[cur_layer * wide * tall + pos];
  26. break;
  27. }
  28. ++cur_layer;
  29. }
  30. }
  31.  
  32. for (int i = 0; i < res.size(); ++i) {
  33. if (i % 25 == 0)
  34. cout << '\n';
  35.  
  36. if (res[i] == '1')
  37. cout << "# ";
  38. else
  39. cout << ". ";
  40. }
  41. return 0;
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement