#include <iostream>
#include <cmath>
#include <cstdlib> 
using namespace std;
void multiply1(){
cout << "Введите первое число:" << endl;
float a;
cin >> a;
cout << "Введите второе число:" << endl;
float b;
cin >> b;
cout << "Ответ: " << a * b << endl;
}

void divide1(){
cout << "Введите делимое:" << endl;
float c;
cin >> c;
cout << "Введите делитель:" << endl;
float d;
cin >> d;
cout << "Ответ: " << c / d << endl;
}
void subtract1(){
cout << "Введите уменьшаемое:" << endl;
float f;
cin >> f;
cout << "Введите вычитаемое:" << endl;
float g;
cin >> g;
cout << "Ответ: " << f - g << endl;
}

void add1(){
cout << "Введите первое число:" << endl;
float h;
cin >> h;
cout << "Введите второе число:" << endl;
float i;
cin >> i;
cout << "Ответ: " << h + i << endl;
}
void root1(){
cout << "Введите число:" << endl;
double se;
cin >> se;
cout << "Введите степень:" << endl;
double pe;
cin >> pe;
cout << "Ответ: " << pow(se, 1.0 / pe) << endl;
}
void stp1(){
cout << "Введите число:" << endl;
double at;
cin >> at;
cout << "Введите степень:" << endl;
double pat;
cin >> pat;
cout << "Ответ: " << pow(at, pat) << endl;
}
int main () {
setlocale(LC_ALL, "Russian");
system("color a");
int act0;
  char ans;
  do{
   cout << "Вас приветствует портативный калькулятор!" << endl;
cout << "Выбирете действие:" << endl;
cout << "1 - Умножить" << endl;
cout << "2 - Разделить" << endl;
cout << "3 - Прибавить" << endl;
cout << "4 - Вычесть" << endl;
cout << "5 - Найти корень" << endl;
cout << "6 - Возвести в степень" << endl;
cin >> act0;
if (act0 != 1 || act0 != 2 || act0 != 3 || act0 != 4 || act0 != 5 || act0 != 6){
cout << "Ошибка" << endl;
Sleep(2000);
return 0;}
switch (act0)
case 1: multiply1()
break;
case 2: divide1()
break;
case 3: add1()
break;
case 4: subtract1()
break;
case 5: root1()
break;
case 6: stp1()
break;
      cout << "Продолжить: Y / N ";
      cin >> ans;
  }while ( toupper( ans ) == 'Y' );
return 0;
}