Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
383 B
1
Indexable
Never
#include <iostream>
#include <cmath> 
#include <iomanip>
#include <cstdlib>
using namespace std; 

int main(){
    int t;
    cin >> t;
    int a=0;
    int isT = 0;
    long long summ = 0;
    do {      
      if (isT == 1) {
            summ += a;
        }
        cin >> a;
        if (a == t ) isT ++;
    } while ( isT != 2);
    cout << summ - t;
}