Run ID:62069
提交时间:2023-12-17 00:19:32
#include<iostream> #include<cstdio> using namespace std; int main(){ int a,b,c,d,e,f,g,h; cin>>a>>b>>c>>d>>e>>f>>g; if(g!=0){ for(int i=1;i<=a;i++){ h+=g; } } else if(f!=0){ for(int i=1;i<=a;i++){ h+=f; } } else if(e!=0){ for(int i=1;i<=a;i++){ h+=e; } } else if(d!=0){ for(int i=1;i<=a;i++){ h+=d; } } else if(c!=0){ for(int i=1;i<=a;i++){ h+=c; } } else if(b!=0){ for(int i=1;i<=a;i++){ h+=b; } } cout<<a*1+b*2+c*3+d*4+e*5+f*6+g*7+h; return 0; }