Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int main() {
- int n;
- cin >> n;
- cin.ignore();
- for (int i = 0; i < n; i++) {
- string inp;
- getline(cin, inp);
- if (inp == "P=NP") {
- cout << "skipped\n";
- }
- else {
- int index = inp.find("+");
- int first = stoi(inp.substr(0, index));
- int second = stoi(inp.substr(index + 1));
- cout << first + second << endl;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement