-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path1097.cpp
45 lines (33 loc) · 786 Bytes
/
1097.cpp
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
// https://judge.beecrowd.com/en/problems/view/1097
/*
Time Complexity =>
Space Complexity =>
*/
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
ifstream input("input.txt");
ofstream output("output.txt");
const int INCREMENT_COUNTER = 2;
const int INITIAL_COUNTER = 3;
int INITIAL_I = 1;
int INITIAL_J = 7;
int I = INITIAL_I, J = INITIAL_J, counter = INITIAL_COUNTER;
while (I <= 9) {
cout << "I=" << I << " J=" << J << endl;
J--;
counter--;
if (counter == 0) {
INITIAL_I += INCREMENT_COUNTER;
I = INITIAL_I;
INITIAL_J += INCREMENT_COUNTER;
J = INITIAL_J;
counter = INITIAL_COUNTER;
}
}
return 0;
}