Advertisement
dsdeep

URI 1021 T

Jun 12th, 2020
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.00 KB | None | 0 0
  1. #include<stdio.h>
  2. int main() {
  3.  
  4.    double a;
  5.     scanf("%lf",&a);
  6.     int x,b,c,d,e,f,g,h,i,j,k,l,m;
  7.     x=a*100;
  8.     b=x/10000;
  9.     x=x%10000;
  10.     c=x/5000;
  11.     x=x%5000;
  12.     d=x/2000;
  13.     x=x%2000;
  14.     e=x/1000;
  15.     x=x%1000;
  16.     f=x/500;
  17.     x=x%500;
  18.     g=x/200;
  19.     x=x%200;
  20.     h=x/100;
  21.     x=x%100;
  22.     i=x/50;
  23.     x=x%50;
  24.     j=x/25;
  25.     x=x%25;
  26.     k=x/10;
  27.     x=x%10;
  28.     l=x/5;
  29.     x=x%5;
  30.     m=x;
  31.     printf("NOTAS:\n");
  32.     printf("%d nota(s) de R$ 100.00\n",b);
  33.     printf("%d nota(s) de R$ 50.00\n",c);
  34.     printf("%d nota(s) de R$ 20.00\n",d);
  35.     printf("%d nota(s) de R$ 10.00\n",e);
  36.     printf("%d nota(s) de R$ 5.00\n",f);
  37.     printf("%d nota(s) de R$ 2.00\n",g);
  38.     printf("MOEDAS:\n");
  39.     printf("%d moeda(s) de R$ 1.00\n",h);
  40.     printf("%d moeda(s) de R$ 0.50\n",i);
  41.     printf("%d moeda(s) de R$ 0.25\n",j);
  42.     printf("%d moeda(s) de R$ 0.10\n",k);
  43.     printf("%d moeda(s) de R$ 0.05\n",l);
  44.     printf("%d moeda(s) de R$ 0.01\n",m);
  45.  
  46.     return 0;
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement