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 11:20
The kurt vonnegut commencement speech, the neiman-marcus chocolate chip cookie recipe, and the get-well emails to the dying boy are examples of select one: a. social engineering b. hoax emails c. email viruses d. worms
Answers: 1
question
Computers and Technology, 22.06.2019 15:20
The north and south regions had very diferent economies in the 1800s.
Answers: 1
question
Computers and Technology, 23.06.2019 07:10
If you want to import a picture into a dtp application, what must you do first? draw an image frame. import text. open the folder containing the file. select get image… from the windows menu.
Answers: 2
question
Computers and Technology, 23.06.2019 21:00
Which set of steps will organize the data to only show foods with more than 100 calories and rank their sugar content from greatest to least?
Answers: 1
You know the right answer?
terminate called after throwing an instance of 'std::invalid_argument' what(): stoiclass Solution {...
Questions
Questions on the website: 13722363