Re: 11608 - No Problem
Posted: Fri Oct 22, 2010 6:16 pm
I'm getting WA on this problem, the test case works and the other test case that someone posted in here works, not sure what is going on.
Thanks!
Thanks!
Code: Select all
//no problem
#include <iostream>
using namespace std;
int main(){
int months[15], probs[15];
int probstart, probtotal;
int count = 0;
while(cin >> probstart){
count++;
if (probstart < 0){
return 0;
}
for (int i = 0; i < 12; i++){
cin >> months[i];
}
for (int j = 0; j < 12; j++){
cin >> probs[j];
}
cout << "Case " << count << ":" << endl;
probtotal = probstart;
for (int k = 0; k < 12; k++){
if (probtotal >= probs[k]){
probtotal = probtotal - probs[k];
cout << "No problem! :D" << endl;
}
else{
cout << "No problem. :(" << endl;
}
probtotal = probtotal + months[k + 1];
}
}
return 0;
}