// UVa 12279 - Emoogle Balance #include <iostream> using namespace std; int main() { int caseNumber = 0; int n; while (cin >> n && n) { caseNumber++; int balance = 0; for (int i = 0; i < n; i++) { int number; cin >> number; if (number) balance++; else balance--; } cout << "Case " << caseNumber << ": " << balance << endl; } return 0; }
No comments:
Post a Comment