Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
334872 小林老师 【C3-9】手机话费 C++ 通过 100 2 MS 240 KB 325 2025-07-20 22:26:38

Tests(1/1):


/*手机话费 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; }


测评信息: