Tuesday, December 22, 2020

Smallest Numbers of Notes-FLOW005

Solution for "Smallest Numbers of Notes-FLOW005 " of Codechef beginner.


#include <bits/stdc++.h> 

using namespace std;

int main() {
    int t;
    cin>>t;
    while(t--){
    
    int n;
    cin>>n;
    int count=0;
    while(n!=0){
        if(n%100==0){
            count++;
            n=n-100;
        }
        else if(n%50==0)
        {
            count++;
            n=n-50;
        }
         else if(n%10==0)
        {
            count++;
            n=n-10;
        }
         else if(n%5==0)
        {
            count++;
            n=n-5;
        }
         else if(n%2==0)
        {
            count++;
            n=n-2;
        }
         else if (n%1==0)
        {
            count++;
            n=n-1;
        }
       
    }
    cout<<count<<endl;
    
    
}
}

Smallest Numbers of Notes-FLOW005

Solution for "Smallest Numbers of Notes-FLOW005 " of Codechef beginner. #include <bits/stdc++.h>  using namespace std; int m...