Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <map>
- using namespace std;
- string entry(multimap<int, string> &mapp) {
- string b = "";
- cout << "Сколько будет переменных : ";
- int c;
- cin >> c;
- cout << "Вводятся только коэффиценты и степени переменных" << endl;
- int a;
- int k;
- for (int i = 0; i < c; i++) {
- a = 0;
- k = 0;
- cout << "Введите множетель : ";
- cin >> a;
- if (a > 0 && i>0) b += "+";
- b += to_string(a);
- //a = 0;
- cout << "Введите степень переменной Х : ";
- cin >> k;
- b += "x^";
- b += to_string(k);
- //a = 0;
- *mapp.insert[a] = k;
- }
- return b;
- }
Add Comment
Please, Sign In to add comment