Monday, November 13, 2017

Smallest Numbers of Note Codechef Problem Solution

https://www.codechef.com/problems/FLOW005


In C++......................

#include<iostream>

using namespace std;

int main()

{
    int t,a,b,c,d,e,f,g,h;
    cin>>t;
    while(t--)
    {
        cin>>a;
        b=(a/100);
        c=((a%100)/50);
        d=((((a%100)%50))/10);
        e=(((((a%100)%50))%10)/5);
        f=((((((a%100)%50))%10)%5)/2);
        g=(((((((a%100)%50))%10)%5)%2)/1);
        cout<<b+c+d+e+f+g<<endl;
    }
    return 0;
}




No comments:

Post a Comment