Codechef Problems: Can You Bench (HJJ)

Problem Statement: 


Solution: 

Given, 
    X : kg of load for 1st set of bench press 
    condition : each successive set increase load by 10 kg

to find - load at 3rd set 

load of 1st set -> X kg 
load of 2nd set -> X + 10 kg 
load of 3rd set -> X + 20 kg

so answer of load at 3rd set will be (X + 20) 

Code Solution: 

#include <bits/stdc++.h>

using namespace std;

int main() {
    int x;
    cin >> x;

    cout << x + 20 << endl;
    return 0;
}

Comments

Popular Posts