AT5308题解

· · 题解

思路

## 代码 ```cpp #include <iostream> #include <cstdio> #include <cmath> using namespace std; inline int read() { int x=0,f=1;char ch=getchar(); while (!isdigit(ch)){if (ch=='-') f=-1;ch=getchar();} while (isdigit(ch)){x=x*10+ch-48;ch=getchar();} return x*f; } int main(){ int ans=0; for(int n=read(),k=read();n;n/=k,++ans);//压行 cout<<ans; return 0; } ```