Codechef Problems: Triangles (TRIANGLE7)

 Problem Statement: 

Solution: 

Given, 
    A : First Angle of Triangle 
    B : Second Angle of Triangle 
To find, 
    C : Third angle of Triangle 

By Angle Sum property of Triangle, 
    A + B + C = 180'
    C = 180 - (A + B)

Code Solution: 

#include <bits/stdc++.h>

using namespace std;

int main() {
    int a, b;
    cin >> a >> b;

    cout << 180 - (a + b) << endl;
    return 0;
}

Comments