subject

terminate called after throwing an instance of 'std::invalid_argument' what(): stoiclass Solution { public: string complexNumberMultiply(string a, string b) { int aplus = a. find('+'); int bplus = b. find('+'); int ai = a. find('i'); int bi = b. find('i'); int a1 = stoi(a. substr(0, aplus)); int b1 = stoi(a. substr(aplus + 1, ai), nullptr); int a2 = stoi(a. substr(0, bplus), nullptr); int b2 = stoi(a. substr(bplus + 1, bi), nullptr); int aa = a1 * a2 - (b1 * b2); int ab = a1 * b2 + a2 * b1; string res = to_string(aa) + "+" + to_string(ab) + "i"; return res; }};

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 09:40
It is vital to research each of the services you plan to disable before implementing any change, especially on critical machines such as the: a. servers in the test environment. b. domain controller and other infrastructure servers. c. desktops that have previously been attacked. d. desktops used by upper-level management.
Answers: 2
question
Computers and Technology, 22.06.2019 10:20
Print "usernum1 is negative." if usernum1 is less than 0. end with newline. convert usernum2 to 0 if usernum2 is greater than 10. otherwise, print "usernum2 is less than or equal to 10.". end with newline
Answers: 3
question
Computers and Technology, 22.06.2019 16:30
Technician a says that a dry sump system uses no oil storage sump under the engine. technician b says that a wet sump system uses no oil storage sump under the engine. who is correct?
Answers: 3
question
Computers and Technology, 22.06.2019 21:30
How do you take a green screen out of the video while editing?
Answers: 2
You know the right answer?
terminate called after throwing an instance of 'std::invalid_argument' what(): stoiclass Solution {...
Questions
question
Mathematics, 07.07.2019 07:00
question
Mathematics, 07.07.2019 07:00
Questions on the website: 13722364