Sum of ten number using two variable

 avatar
user_3266551
c_cpp
a year ago
278 B
1
Indexable
Never
#include<bits/stdc++.h>
using namespace std;

int main()
{

    pair<int, int> sum_and_count = {0, 10};
    

    while(sum_and_count.second--)
    {
        int x;
        cin>> x;

        sum_and_count.first += x;
    }

    cout<< sum_and_count.first<< endl;
    return 0;
}