小明上学(CCF认证2018-12-1 )

#include<bits/stdc++.h>
using namespace std;
int main(){
    int red,yellow,green,N,a,b,ans=0;
    cin>>red>>yellow>>green>>N;
    while(~scanf("%d%d",&a,&b))
        if(a==0||a==1)
            ans+=b;
        else if(a==2)
            ans+=b+red;
    cout<<ans<<endl;
    return 0;
}

猜你喜欢

转载自www.cnblogs.com/Shallow-dream/p/11456353.html