mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
Create 2021.cpp
This commit is contained in:
parent
61bbc34db9
commit
9792605e6a
51
HDOJ/2021.cpp
Normal file
51
HDOJ/2021.cpp
Normal file
|
@ -0,0 +1,51 @@
|
|||
#include <iostream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <queue>
|
||||
#include <algorithm>
|
||||
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
|
||||
/// This Contest and Compile does not support C++11.
|
||||
//#include <thread>
|
||||
//#include <mutex>
|
||||
//#include <condition_variable>
|
||||
//#include <functional>
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
||||
int main()
|
||||
{
|
||||
//cout<<"Hello World!"<<endl;
|
||||
while(1)
|
||||
{
|
||||
int n;
|
||||
cin>>n;
|
||||
if(!n) break;
|
||||
int cc=0;
|
||||
for(int i=0;i<n;i++)
|
||||
{
|
||||
int temp;
|
||||
cin>>temp;
|
||||
int ans=0;
|
||||
ans+=temp/100;
|
||||
temp%=100;
|
||||
ans+=temp/50;
|
||||
temp%=50;
|
||||
ans+=temp/10;
|
||||
temp%=10;
|
||||
ans+=temp/5;
|
||||
temp%=5;
|
||||
ans+=temp/2;
|
||||
temp%=2;
|
||||
ans+=temp;
|
||||
cc+=ans;
|
||||
}
|
||||
cout<<cc<<endl;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user