Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- int N,x,y,z,r1,r2,r3,r4,r5,r6,r7,a,b,c,d,e;
- scanf("%d",&N);
- printf("%d\n",N);
- if (N > 100)
- {
- x = N / 100;
- r1 = N % 100;
- } if (r1<100)
- {
- y = r1 / 50;
- r2 = r1 % 50;
- } if (r2<50)
- {
- z = r2 / 20;
- r3 = r2 % 20;
- } if (r3<20)
- {
- a = r3 / 10;
- r4 = r3 % 10;
- } if (r4<10)
- {
- b = r4 / 5;
- r5 = r4 % 10;
- } if (r5<5)
- {
- c = r5 / 2;
- r6 = r5 % 2;
- }
- if (r6<2)
- {
- d = r6 / 2;
- r7 = r6 % 2;
- }
- if (r7=1)
- {
- e = r7 / 1;
- }
- printf("%d nota(s) de R$ 100,00\n",x);
- printf("%d nota(s) de R$ 50,00\n",y);
- printf("%d nota(s) de R$ 20,00\n",z);
- printf("%d nota(s) de R$ 10,00\n",a);
- printf("%d nota(s) de R$ 5,00\n",b);
- printf("%d nota(s) de R$ 2,00\n",c);
- printf("%d nota(s) de R$ 1,00\n",d);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement