#include <iostream> #include <algorithm> #include <cstdio> #include <math.h> #include <iomanip> #include <set> #include <list> #include <queue> #include <map> #include <vector> #include <stack> #include <string> constexpr int N = 1e6 + 7; int main() { std::ios_base::sync_with_stdio(0); std::cin.tie(0); int n; std::cin >> n; std::string napis = ""; if (n == 1) { napis += "FBD"; std::cout << napis; return 0; } else { std::string y = std::to_string(n); napis += y; napis += "F"; napis += y; napis += "B"; napis += "D"; for (int i = n - 1; i > 1; --i) { std::string x = std::to_string(i); napis += x; napis += "E"; napis += x; napis += "[AC]"; napis += "D"; } napis += "EACD"; std::cout << napis; return 0; } }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | #include <iostream> #include <algorithm> #include <cstdio> #include <math.h> #include <iomanip> #include <set> #include <list> #include <queue> #include <map> #include <vector> #include <stack> #include <string> constexpr int N = 1e6 + 7; int main() { std::ios_base::sync_with_stdio(0); std::cin.tie(0); int n; std::cin >> n; std::string napis = ""; if (n == 1) { napis += "FBD"; std::cout << napis; return 0; } else { std::string y = std::to_string(n); napis += y; napis += "F"; napis += y; napis += "B"; napis += "D"; for (int i = n - 1; i > 1; --i) { std::string x = std::to_string(i); napis += x; napis += "E"; napis += x; napis += "[AC]"; napis += "D"; } napis += "EACD"; std::cout << napis; return 0; } } |