255A Greg's Workout codeforces solution in cpp
by ujjal roy
#include<bits/stdc++.h>
using namespace std;
main()
{
int n,i,c=0,che=0,bi=0,ba=0,a;
cin>>n;
for(i=0;i<n;i++)
{
cin>>a;
c=i%3;
if(c==0)
{
che+=a;
}
else if(c==1)
{
bi+=a;
}
else
{
ba+=a;
}
}
if(che>bi&&che>ba) cout<<"chest"<<endl;
else if(bi>che&&bi>ba) cout<<"biceps"<<endl;
else cout<<"back"<<endl;
return 0;
}
0 Comments