#include <iostream>
#include<cmath>
using namespace std;
int LiczenieOstCyfryPotegi(int a, int b)
{
int wynik;
if (a == 0)
return 0;
else if (a == 1)
return 1;
else if (a == 2)
{
if (b % 2 == 0)
return 4 albo 6;
else return 2 albo 8;
}
else if (a == 3)
{
if (b % 2 == 0)
return 9 albo 1;
else return 3 albo 7;
}
else if (a == 4)
{
if (b % 2 == 0)
return 6;
else return 4;
}
else if (a == 5)
{
return 5;
}
else if (a == 6)
{
return 6;
}
else if (a == 7)
{
if (b % 2 == 0)
return 4 albo 1;
else return 7 albo 3;
}
else if (a == 8)
{
if (b % 2 == 0)
return 4 albo 6;
else return 8 albo 2;
}
else if (a == 9)
{
if (b % 2 == 0)
return 1;
else return 9;
}
}
int main()
{
int ilosc, a, b, c;
cout << "Ile liczb chcesz wpisac?: ";
cin >> ilosc;
for (int i = 0; i < ilosc; i++)
{
cout << "wpisz podstawe a i b " << endl;
cin >> a >> b;
cout << LiczenieOstCyfryPotegi(a, b);
}
}
chyba zczailem koncept, ale nie wiem jeszcze jak poradzic sobie z poczwórnymi warunkami, bo podwójne po prostu rozdzieliłem je na warunki parzyste i nieparzyste
i wiem ( pogladowo dalem sobie to “albo”, bo nie wiem jak sobie z tym poradzić)