lanqiao 2098 刷题统计(枚举法)

This commit is contained in:
2025-03-29 17:16:52 +08:00
parent c30fcc30d0
commit f5d902c81a

21
13lanqiao/test3-1.cpp Normal file
View File

@@ -0,0 +1,21 @@
// lanqiao 2098 刷题统计(枚举法)
#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
int a, b, n; cin >> a >> b >> n;
int sum = 0, i;
for(i = 1; ;i++){
if(i % 7 != 0 && i % 7 != 6){
sum += a;
}else{
sum += b;
}
if(sum >= n) break;
}
cout << i << endl;
return 0;
}
/* test samples -> 8
10 20 99
*/