fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. long long n;
  6. long long sum = 0;
  7. long long count = 0;
  8.  
  9. while (cin >> n) {
  10. sum += n;
  11. count++;
  12. }
  13.  
  14. cout << sum - (count - 1);
  15. return 0;
  16. }
  17.  
Success #stdin #stdout 0.01s 5260KB
stdin
Standard input is empty
stdout
1