Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // my first c++ program
- #include <iostream>
- using namespace std;
- int main()
- {
- short penentu = 0;
- cout << "[ Program Unpangkat ]\n\n";
- long a;
- cout << "[?] Berapa angkanya: ";
- cin >> a;
- long b;
- cout << "[?] Berapa pangkatnya: ";
- cin >> b;
- long angka = 0;
- while (angka < a / 5)
- {
- if (penentu != 0)
- {
- break;
- }
- angka += 1;
- long hitung = 1;
- for(long c = 1; c <= b; c++)
- {
- hitung *= angka;
- }
- if (hitung == a)
- {
- cout << "[+] Hasilnya " << angka;
- penentu += 1;
- break;
- }
- }
- if (penentu == 0)
- {
- cout << "[!] Tidak ada hasil ditemukan";
- }
- }
Add Comment
Please, Sign In to add comment