Saturday 16 January 2016

Solution of URI 1018 :: Banknotes


Before seeing the solution make sure that you tried enough. Don’t paste the whole code, just find out the logic. If you stuck in trouble, just inform me on comment.

/**Bismillahir Rahmanir Rahim.**/

#include <stdio.h>

int main()
{
    int N,a,b,c,d,e,f,g,h,i,j,k,l;
    scanf ("%d", &N);
    a=N/100;
    b=N%100;
    c=b/50;
    d=b%50;
    e=d/20;
    f=d%20;
    g=f/10;
    h=f%10;
    i=h/5;
    j=h%5;
    k=j/2;
    l=j%2;
    printf ("%d\n",N);
    printf ("%d nota(s) de R$ 100,00\n",a);
    printf ("%d nota(s) de R$ 50,00\n",c);
    printf ("%d nota(s) de R$ 20,00\n",e);
    printf ("%d nota(s) de R$ 10,00\n",g);
    printf ("%d nota(s) de R$ 5,00\n",i);
    printf ("%d nota(s) de R$ 2,00\n",k);
    printf ("%d nota(s) de R$ 1,00\n",l);
    return 0;
}

3 comments:

  1. shuru ta valo legeche vai......

    ReplyDelete
  2. এর নিচে যদি problem explain করে দিতেন তাহলে ভালো হতো ।

    ReplyDelete
  3. madarchod ki manus naki ,,, baler solve desa

    ReplyDelete

Note: only a member of this blog may post a comment.