Advertisement
dsdeep

URI 1021 - 10

Feb 28th, 2020
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.76 KB | None | 0 0
  1. float a;
  2.    scanf("%f",&a);
  3.    int b=a*100;
  4.    printf("NOTAS:\n");
  5.    printf("%d nota(s) de R$ 100.00\n",b/10000);
  6.    b=b%10000;
  7.    printf("%d nota(s) de R$ 50.00\n",b/5000);
  8.    b=b%5000;
  9.    printf("%d nota(s) de R$ 20.00\n",b/2000);
  10.    b=b%2000;
  11.    printf("%d nota(s) de R$ 10.00\n",b/1000);
  12.    b=b%1000;
  13.    printf("%d nota(s) de R$ 5.00\n",b/500);
  14.    b=b%500;
  15.    printf("%d nota(s) de R$ 2.00\n",b/200);
  16.    b=b%200;
  17.    printf("MOEDAS:\n");
  18.    printf("%d nota(s) de R$ 1.00\n",b/100);
  19.    b=b%100;
  20.    printf("%d nota(s) de R$ 0.50\n",b/50);
  21.    b=b%50;
  22.    printf("%d nota(s) de R$ 0.25\n",b/25);
  23.    b=b%25;
  24.    printf("%d nota(s) de R$ 0.10\n",b/10);
  25.    b=b%10;
  26.    printf("%d nota(s) de R$ 0.05\n",b/5);
  27.    b=b%5;
  28.    printf("%d nota(s) de R$ 0.01\n",b/1);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement