문제 링크
설명은 장황한데 배열 순회하는 문제
개 입력을 받아서 0이면 -1, 0이 아니면 +1 해주는 연산해서 결과값 도출
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define INF 1000000000
int t;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
for (int tc = 1; ; tc++){
int n;
cin >> n;
if (n == 0) break;
int ans = 0;
for (int i = 1; i <= n; ++i) {
int t; cin >> t;
if (t == 0) ans--;
else ans++;
}
cout << "Case " << tc << ": " << ans << '\n';
}
}