Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int n,x;
- cin >> n >> x;
- for (int i=1; i<=n; ++i) {
- int o, total=0;
- while (cin >> o and o!=x) total+=o;
- string s;
- getline(cin,s);
- cout << "La suma de la secuencia " << i << " es " << total << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment