Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #define SIZE 12
- int main()
- {
- int amount, notes;
- int moznosti;
- moznosti = 0;
- int denominations[SIZE] = {5000, 2000, 1000, 500, 200, 100, 50, 20, 10, 5, 2, 1};
- printf("Zadejte částku, pro kterou chce zobrazit možnosti rozměněni: ");
- scanf("%d", &amount);
- int castka = amount;
- printf("\n");
- printf("počet možností: %d \n", moznosti);
- for (int i = 0; i < SIZE; i++)
- {
- notes = amount / denominations[i];
- if (notes)
- {
- amount = amount % denominations[i]; // remaining money
- printf("%d * %d = %d kc \n", notes, denominations[i],
- notes * denominations[i]);
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement