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 971 (Div. 4) 2009C. The Legend of Freya the Frog Solution

  Problem Link    https://codeforces.com/contest/2009/problem/C S olution in C++: /// Author : AH_Tonmoy #include < bits / stdc ++. h &g...

Powered by Blogger.