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

RESTful APIs with CRUD Operations in Laravel 12| (2025)

  RESTful APIs serve as the foundation of modern web development. They follow a set of rules called Representational State Transfer (REST) t...

Powered by Blogger.