Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- //Pre: Llegeix una seqüència de parells naturals
- //Post: Escriu el nombre de xifres de n en base b
- int main() {
- int b, n;
- while (cin >> b) {
- cin >> n;
- int count = 0;
- while (n != 0) {
- n = n/b;
- ++count;
- }
- cout << count << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement