Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int main() {
- ios_base::sync_with_stdio(false);
- int n = 0;
- cin >> n;
- int ile7 = 0;
- while (n > 17) {
- ++ile7;
- n -= 7;
- }
- int r = n;
- if (r == 0) {
- for (int i = 0; i < ile7; ++i)
- cout << 8;
- }
- else {
- if (r == 17) {
- cout << 200;
- }
- if (r == 16) {
- cout << 188;
- }
- if (r == 15) {
- cout << 108;
- }
- if (r == 14) {
- cout << 88;
- }
- if (r == 13) {
- cout << 68;
- }
- if (r == 12) {
- cout << 28;
- }
- if (r == 11) {
- cout << 20;
- }
- if (r == 10) {
- cout << 22;
- }
- if (r == 9) {
- cout << 18;
- }
- if (r == 8) {
- cout << 10;
- }
- if (r == 7) {
- cout << 8;
- }
- if (r == 6) {
- cout << 0;
- }
- if (r == 5) {
- cout << 2;
- }
- if (r == 4) {
- cout << 4;
- }
- if (r == 3) {
- cout << 7;
- }
- if (r == 2) {
- cout << 1;
- }
- if (r == 1) {
- cout << "NIE";
- }
- }
- for (int i = 0; i < ile7; ++i)
- cout << 8;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement