Codeforces 996A. Hit the Lottery Solution

Solve in C++:

//AH Tonmoy
//Department of CSE ,Islamic University
#include<iostream>
using namespace std;
int main(){

 int64_t n,s=0;
 while(cin>>n)
 {
     s=s+(n/100);
     n=n%100;
     s=s+(n/20);
     n=n%20;
     s=s+(n/10);
     n=n%10;
     s=s+(n/5);
     n=n%5;
     s=s+(n/1);
     n=n%1;
     s=s+n;
     cout<<s<<endl;
     s=0;
 }

}

No comments

Most View Post

Recent post

Codeforces Round 925 (Div. 3) 1931D. Divisible Pairs Solution

    Problem Link  :   https://codeforces.com/contest/1931/problem/D S olution in C++: /// Author : AH_Tonmoy #include < bits / stdc ++. ...

Powered by Blogger.