File tree 1 file changed +8
-8
lines changed 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change 1
- // http://boj.kr/1febea8e97bb4493925075f36d6efb8d
1
+ // http://boj.kr/7c4a1a954b7f4aa19635cf6dcfc5a5c6
2
2
#include < bits/stdc++.h>
3
3
using namespace std ;
4
4
5
- int chk [20 ];
5
+ int state [20 ];
6
6
7
7
int main (){
8
8
ios::sync_with_stdio (0 );
@@ -16,25 +16,25 @@ int main(){
16
16
cin >> com;
17
17
if (com == " add" ){
18
18
cin >> x;
19
- chk [x-1 ] = 1 ;
19
+ state [x-1 ] = 1 ;
20
20
}
21
21
else if (com == " remove" ){
22
22
cin >> x;
23
- chk [x-1 ] = 0 ;
23
+ state [x-1 ] = 0 ;
24
24
}
25
25
else if (com == " check" ){
26
26
cin >> x;
27
- cout << chk [x-1 ] << ' \n ' ;
27
+ cout << state [x-1 ] << ' \n ' ;
28
28
}
29
29
else if (com == " toggle" ){
30
30
cin >> x;
31
- chk [x-1 ] = 1 ^ chk [x-1 ];
31
+ state [x-1 ] = 1 ^ state [x-1 ];
32
32
}
33
33
else if (com == " all" ){
34
- fill (chk, chk +20 , 1 );
34
+ fill (state, state +20 , 1 );
35
35
}
36
36
else { // empty
37
- fill (chk, chk +20 , 0 );
37
+ fill (state, state +20 , 0 );
38
38
}
39
39
}
40
40
}
You can’t perform that action at this time.
0 commit comments