Advertisement
PedroSG

Untitled

Apr 10th, 2015
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.10 KB | None | 0 0
  1. #include <stdio.h>
  2. int main()
  3.  
  4. {
  5.     int N,x,y,z,r1,r2,r3,r4,r5,r6,r7,a,b,c,d,e;
  6.     scanf("%d",&N);
  7.     printf("%d\n",N);
  8.     if (N > 100)
  9.     {
  10.  
  11.       x = N / 100;
  12.       r1 = N % 100;
  13.     } if (r1<100)
  14.     {
  15.        y = r1 / 50;
  16.        r2 = r1 % 50;
  17.  
  18.     } if (r2<50)
  19.        {
  20.         z = r2 / 20;
  21.         r3 = r2 % 20;
  22.        } if (r3<20)
  23.          {
  24.  
  25.             a = r3 / 10;
  26.             r4 = r3 % 10;
  27.          } if (r4<10)
  28.        {
  29.           b = r4 / 5;
  30.           r5 = r4 % 10;
  31.  
  32.        } if (r5<5)
  33.             {
  34.               c = r5 / 2;
  35.               r6 = r5 % 2;
  36.             }
  37.         if (r6<2)
  38.         {
  39.             d = r6 / 2;
  40.             r7 = r6 % 2;
  41.         }
  42.         if (r7=1)
  43.         {
  44.             e = r7 / 1;
  45.         }
  46.          printf("%d nota(s) de R$ 100,00\n",x);
  47.          printf("%d nota(s) de R$ 50,00\n",y);
  48.          printf("%d nota(s) de R$ 20,00\n",z);
  49.          printf("%d nota(s) de R$ 10,00\n",a);
  50.          printf("%d nota(s) de R$ 5,00\n",b);
  51.          printf("%d nota(s) de R$ 2,00\n",c);
  52.          printf("%d nota(s) de R$ 1,00\n",d);
  53.     return 0;
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement