uri online judge problem 1018 solution c programming
UIR online judge problem 1018 solution c
programming
code :
#include<stdio.h>
int main()
{
int N,x1,x2,x3,x4,x5,x6,x7;
scanf("%d",&N);
printf("%d\n",N);
x1=N/100;
N=N%100;
printf("%d nota(s) de R$ 100,00\n",x1);
x2=N/50;
N=N%50;
printf("%d nota(s) de R$ 50,00\n",x2);
x3=N/20;
N=N%20;
printf("%d nota(s) de R$ 20,00\n",x3);
x4=N/10;
N=N%10;
printf("%d nota(s) de R$ 10,00\n",x4);
x5=N/5;
N=N%5;
printf("%d nota(s) de R$ 5,00\n",x5);
x6=N/2;
N=N%2;
printf("%d nota(s) de R$ 2,00\n",x6);
x7=N/1;
N=N%1;
printf("%d nota(s) de R$ 1,00\n",x7);
return 0;
}
output :
programming
code :
#include<stdio.h>
int main()
{
int N,x1,x2,x3,x4,x5,x6,x7;
scanf("%d",&N);
printf("%d\n",N);
x1=N/100;
N=N%100;
printf("%d nota(s) de R$ 100,00\n",x1);
x2=N/50;
N=N%50;
printf("%d nota(s) de R$ 50,00\n",x2);
x3=N/20;
N=N%20;
printf("%d nota(s) de R$ 20,00\n",x3);
x4=N/10;
N=N%10;
printf("%d nota(s) de R$ 10,00\n",x4);
x5=N/5;
N=N%5;
printf("%d nota(s) de R$ 5,00\n",x5);
x6=N/2;
N=N%2;
printf("%d nota(s) de R$ 2,00\n",x6);
x7=N/1;
N=N%1;
printf("%d nota(s) de R$ 1,00\n",x7);
return 0;
}
output :

No comments