一份缺氧的代码,dalao帮忙看能不能优化
查看原帖
一份缺氧的代码,dalao帮忙看能不能优化
845502
huangzixiao2010楼主2023/2/6 13:54

这就是缺氧的代码

#include<iostream>
using namespace std;
long long int a,b,c,d=0;
int main(){
    int i=0;
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin>>a>>b;
    while(d!=1){   
        ++i;
		d=a+d;
    	if(d>b){
		while(d>b)d-=b;
		}
    }
    cout<<i;
    return 0;
}
2023/2/6 13:54
加载中...