Codechef Problems: Basketball Score (P1BAR)
Problem Statement:
https://www.codechef.com/problems/P1BAR
Solution:
Given, X : number of 3-pointers scored
Y :
number of 2-pointers scored
To find, compute the final score of the team
Final score = score by 2 pointers + score by 3 pointers
=
Y * 2 + X * 3
Code Solution:
#include <bits/stdc++.h>
using namespace std;
int main() {
int x, y;
cin >> x >> y;
cout << x *
3 + y * 2 << endl;
return 0;
}
Comments
Post a Comment