1. 程式人生 > >#256 (Div. 2)A. Rewards

#256 (Div. 2)A. Rewards

放大 c++ cout esp its for col span cin

題意:三種獎杯各ai個,三種獎牌各bi個,給出N個櫃子,每個櫃子不能同時放獎杯獎牌,不能放大於5個獎杯,10個獎牌

思路:水

 1 #include<bits/stdc++.h>
 2 using namespace std;
 3 
 4 int main(){
 5     int x;
 6     int sum=0,sum1=0,s,s1,n;
 7     for(int i=1;i<=3;i++){
 8         cin>>x;
 9         sum+=x;
10     }
11     for(int i=1;i<=3;i++){
12 cin>>x; 13 sum1+=x; 14 } 15 if(sum%5==0) s=sum/5; 16 else s=sum/5+1; 17 if(sum1%10==0) s1=sum1/10; 18 else s1=sum1/10+1; 19 cin>>n; 20 if(s+s1<=n){ 21 cout<<"YES"<<endl; 22 } 23 else cout<<"NO"<<endl; 24 }

#256 (Div. 2)A. Rewards