全部评论 2

  • #include <bits/stdc++.h>
    using namespace std;

    int main() {
    double a,b,c;
    cin>>a>>b>>c;
    int cnt=3;
    double d=sqrt(aa+bb);
    if(a>c){ cout<<1; return 0;}
    if(b>c){cout<<2; return 0;}
    while(sqrt(aa+bb)<=c){
    d=sqrt(aa+bb);
    a=b;
    b=d;
    cnt++;
    }
    cout<<cnt;
    return 0;
    }

    2天前 来自 湖北

    0
  • while(sqrt(aa+bb)<=c){ // 或先算 d 再用 d<=c 判断
    d=sqrt(aa+bb);
    a=b;
    b=d;
    cnt++;
    }
    为啥这样写

    2天前 来自 湖北

    0
暂无数据

提交答案之后,这里将显示提交结果~

首页