我不理解,哪里错了
查看原帖
我不理解,哪里错了
384010
doubleyu楼主2022/10/27 16:58
#include <bits/stdc++.h>
using namespace std;
inline int read(){
	int x=0,f=1;
	char c=getchar();
	while(c<'0' || c>'9'){
		if(c=='-'){
			f=-1;
		}
		c=getchar();
	}
	while(c>='0' && c<='9'){
		x=x*10+c-'0';
		c=getchar();
	}
	return x*f;
}
int main(){
	int a,b,n,cc=0,dd=0,zz=0,sum=0,ans=0;
	cin>>a>>b>>n;
	while(1){
		if(sum>=n){
			cout<<ans;
			return 0;
		}
		if(cc==5){
			cc=0;
			zz=1;
		}
		if(dd==2){
			dd=0;
			zz=0;
		}
		if(zz==0){
			sum+=a;
			cc++;
		}
		else{
			sum+=b;
			dd++;
		}
		ans++;
	}
	return 0;
}
```cpp
2022/10/27 16:58
加载中...