HDU 5018 Revenge of Fibonacci

题解:直接计算即可。

#include <cstdio>
#include <algorithm>
using namespace std;
int main(){
    int T;
    scanf("%d",&T);
    while(T--){
        int a,b,c; bool flag=1;
        scanf("%d%d%d",&a,&b,&c);
        if(a==c||b==c){puts("Yes");continue;}
        while(b<c){
            a+=b; swap(a,b);
            if(b==c){puts("Yes");flag=0;}
        }if(flag)puts("No");
    }return 0;
}
原文地址:https://www.cnblogs.com/forever97/p/4024487.html