lanqiao 2098 刷题统计(枚举法)

This commit is contained in:
2025-03-29 17:14:53 +08:00
parent c0e8fee1ac
commit c30fcc30d0

21
13lanqiao/test3.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
*/