Sum of ten number using two variable
#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; }