Skip to content

Commit 1e91032

Browse files
Update 11723_1.cpp
1 parent 4018718 commit 1e91032

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Appendix C/11723_1.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
// http://boj.kr/1febea8e97bb4493925075f36d6efb8d
1+
// http://boj.kr/7c4a1a954b7f4aa19635cf6dcfc5a5c6
22
#include <bits/stdc++.h>
33
using namespace std;
44

5-
int chk[20];
5+
int state[20];
66

77
int main(){
88
ios::sync_with_stdio(0);
@@ -16,25 +16,25 @@ int main(){
1616
cin >> com;
1717
if(com == "add"){
1818
cin >> x;
19-
chk[x-1] = 1;
19+
state[x-1] = 1;
2020
}
2121
else if(com == "remove"){
2222
cin >> x;
23-
chk[x-1] = 0;
23+
state[x-1] = 0;
2424
}
2525
else if(com == "check"){
2626
cin >> x;
27-
cout << chk[x-1] << '\n';
27+
cout << state[x-1] << '\n';
2828
}
2929
else if(com == "toggle"){
3030
cin >> x;
31-
chk[x-1] = 1 ^ chk[x-1];
31+
state[x-1] = 1 ^ state[x-1];
3232
}
3333
else if(com == "all"){
34-
fill(chk, chk+20, 1);
34+
fill(state, state+20, 1);
3535
}
3636
else{ // empty
37-
fill(chk, chk+20, 0);
37+
fill(state, state+20, 0);
3838
}
3939
}
4040
}

0 commit comments

Comments
 (0)