Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main() {
- int tc=1;
- while(1) {
- int total;
- scanf("%d",&total);
- if (total < 0) {
- break;
- }
- printf("Case %d:\n",tc);
- int c[12],nn[12];
- int i;
- for (i=0;i<12;i++) {
- scanf("%d", &nn[i]);
- }
- for (i=0;i<12;i++) {
- scanf("%d", &c[i]);
- }
- for (i=0;i<12;i++) {
- if (c[i] <= total) {
- printf("No problem! :D\n");
- tc++;
- total = total - c[i] + nn[i];
- }
- else {
- printf("No problem. :(\n");
- tc++;
- total = total+nn[i];
- }
- }
- tc++;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment