Pandarec13

222

Dec 18th, 2018
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <map>
  4. using namespace std;
  5.  
  6. string entry(multimap<int, string> &mapp) {
  7. string b = "";
  8. cout << "Сколько будет переменных : ";
  9. int c;
  10. cin >> c;
  11. cout << "Вводятся только коэффиценты и степени переменных" << endl;
  12. int a;
  13. int k;
  14.  
  15.  
  16. for (int i = 0; i < c; i++) {
  17. a = 0;
  18. k = 0;
  19. cout << "Введите множетель : ";
  20. cin >> a;
  21. if (a > 0 && i>0) b += "+";
  22. b += to_string(a);
  23. //a = 0;
  24. cout << "Введите степень переменной Х : ";
  25. cin >> k;
  26. b += "x^";
  27. b += to_string(k);
  28. //a = 0;
  29. *mapp.insert[a] = k;
  30.  
  31. }
  32.  
  33. return b;
  34. }
Add Comment
Please, Sign In to add comment