Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int Bankomat(int k);
- int main()
- {
- int kwota;
- printf("Podaj kwote do wyplacenia\n");
- scanf("%d", &kwota);
- printf("%d", Bankomat(kwota));
- return 0;
- }
- int Bankomat(int k)
- {
- int dzielnik;
- if(k%10==0)
- {
- dzielnik = k/200;
- printf("%d * 200", dzielnik);
- k=k%200;
- dzielnik = k/100;
- printf("+ %d *100", dzielnik);
- k=k%100;
- dzielnik = k/50;
- printf("+ %d * 50", dzielnik);
- k=k%50;
- dzielnik = k/10;
- printf("+ %d *10\n", dzielnik);
- }else
- {
- printf("Musisz podac liczbe podzelna przez 10\n");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement