hdu1021(Fibonacci Again)
[cpp]#include <iostream>
#include <cstdio>
using namespace std;
int a[1000010];
int main()
{
a[0] = 7%3; a[1] = 11%3;
int t;
for(int i = 2; i < 1000000; i++){
t = a[i-1]%3 + a[i-2]%3;
a[i] = t%3;
}
int temp;
while(scanf("%d", &temp) != EOF){
if(!a[temp]%3) {
printf("yes\n");
}
else{
printf("no\n");
}
}
return 0;
}
补充:软件开发 , C++ ,