Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define _CRT_SECURE_NO_WARNINGS
- #include <stdio.h>
- #include <stdlib.h>
- int main()
- {
- int money = 0,another = 0,calc = 0;
- printf("Enter how many money do you need now: ");
- scanf("%d",&money);
- if (money % 10 != 0 || money < 0)
- {
- printf("%d", -1);
- return -1;
- }
- printf("500 - %d\n", money / 500);
- calc += money / 500;
- another = money % 500;
- printf("200 - %d\n", another / 200);
- calc += another / 200;
- another = another % 200;
- printf("100 - %d\n", another / 100);
- calc += another / 100;
- another = another % 100;
- printf(" 50 - %d\n", another / 50);
- calc += another / 50;
- another = another % 50;
- printf(" 20 - %d\n", another / 20);
- calc += another / 20;
- another = another % 20;
- printf(" 10 - %d\n", another / 10);
- calc += another / 10;
- another = another % 10;
- printf("Money bills - %d\n", calc);
- getchar();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement