Код:
#include <iostream>
#include <cmath>
using namespace std;
int pow(int x,int n)
{
int t=1;
for(int i=1;i<=n;i++)
t*=x;
return t;
}
int main()
{
int c;
cout<<"c=";
cin>>c;
for(int a=1;a*a<c;a++)
{
int b=int(log((double)c)/log((double)a));
if( pow(a,b)==c)
cout<<a<<'^'<<b<<'='<<c<<endl;
}
system("pause");
return 0;
}