HDU 1021 Fibonacci Again
被坑了!!!这就是一水题,实际上就是找规律,亏我还自己在那算数列= =
1 #include <stdio.h> 2 3 int main(){ 4 int n; 5 /*int i; 6 int a[1000001]; 7 a[0] = 7; 8 a[1] = 11; 9 for(i = 2; i < 1000001; i++){ 10 a[i] = a[i-1] + a[i-2]; 11 }*/ 12 while(scanf("%d",&n) != EOF){ 13 if(n % 4 == 2){ 14 printf("Yes\n"); 15 } 16 else{ 17 printf("no\n"); 18 } 19 } 20 return 0; 21 }
Everything will be ok in the end. If it is not ok then it is not the end.