Run ID:62067

提交时间:2023-12-16 22:24:36

#include<iostream> #include<cstdio> using namespace std; int main(){ int a,b,c,d,e,f,g,h=0; cin>>a>>b>>c>>d>>e>>d>>g; if(g!=0){ for(int i=1;i<=a;i++){ h=h+g; } } else if(f!=0){ for(int i=1;i<=a;i++){ h=h+f; } } else if(e!=0){ for(int i=1;i<=a;i++){ h=h+e; } } else if(d!=0){ for(int i=1;i<=a;i++){ h=h+d; } } else if(c!=0){ for(int i=1;i<=a;i++){ h=h+c; } } else if(c!=0){ for(int i=1;i<=a;i++){ h=h+b; } } cout<<a*1+b*2+c*3+d*4+e*5+f*6+g*6+h; return 0; }