Input Format
A single line containing  space-separated integers: , and .
Constraints
Output Format
Print the sum of the three numbers on a single line.

hackerrank input and output problem solution in c++ programming

Input and Output problem solution in c++ programming | HackerRank

#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;


int main() {

    int sum = 0;
    int x, y, z;

    cin >> x >> y >> z;
    sum = x + y + z;
    cout << sum << endl;

    return 0;
}

Second solution

#include <iostream>
using namespace std;

int main() {
    int a;
    int b;
    int c;
    cin >> a >> b >> c;
    
    cout << a + b + c << endl;
    
    return 0;
}