提交时间:2025-07-20 22:26:38

运行 ID: 334872

/*手机话费 M元,s=0,d天 while(m>0) d++; 消费1元:m-- 至今消费了s元: s++ if s==k: m++ d天 */ #include<bits/stdc++.h> using namespace std; int main(){ int m, k, d=0, s=0; cin>>m>>k; while(m>0){ d++; m--; s++; if(s==k){ m++; s=0; } } cout<<d; return 0; }