提交时间:2021-12-11 14:37:45
运行 ID: 27238
#include<bits/stdc++.h> using namespace std; int n,k,m,a,b,c; int main(){ cin>>n; for(int i=1;i<=n;i++){ cin>>k; if(k==1){ cin>>a>>b; m+=2*a+2*b; }else if(k==2){ cin>>a; m+=4*a; }else if(k==3){ cin>>a>>b>>c; m+=a+b+c; } } cout<<m; }