fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int kwota = 0;
  5. printf("Podaj sume pieniedzy: ");
  6. scanf("%d", &kwota);
  7.  
  8. {
  9. int n = 20;
  10. int r = kwota/n;
  11. if (r > 0) {
  12. printf("%d x %d\n", r, n);
  13. }
  14. kwota -= r*n;
  15. }
  16. {
  17. int n = 10;
  18. int r = kwota/n;
  19. if (r > 0) {
  20. printf("%d x %d\n", r, n);
  21. }
  22. kwota -= r*n;
  23. }
  24. {
  25. int n = 5;
  26. int r = kwota/n;
  27. if (r > 0) {
  28. printf("%d x %d\n", r, n);
  29. }
  30. kwota -= r*n;
  31. }
  32. {
  33. int n = 2;
  34. int r = kwota/n;
  35. if (r > 0) {
  36. printf("%d x %d\n", r, n);
  37. }
  38. kwota -= r*n;
  39. }
  40. {
  41. int n = 1;
  42. int r = kwota/n;
  43. if (r > 0) {
  44. printf("%d x %d\n", r, n);
  45. }
  46. kwota -= r*n;
  47. }
  48.  
  49. return 0;
  50. }
  51.  
Success #stdin #stdout 0s 1836KB
stdin
58
stdout
Podaj sume pieniedzy: 2 x 20
1 x 10
1 x 5
1 x 2
1 x 1