Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<iomanip>
- using namespace std;
- void potencija(int);
- int main()
- {
- int broj;
- cout << "Unesi broj :" << endl;
- cin >> broj;
- potencija(broj);
- system("pause>0");
- return 0;
- }
- void potencija(int br)
- {
- int brojac = 0, x = br-1;
- while (brojac == 0)
- {
- x++;
- for (int i = 2; i < br; i++)
- {
- for (int j = 2; j < br; j++)
- {
- if (pow(i, j) == x)
- {
- brojac++;
- cout << i << " ^ " << j << " = " << x << endl;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement