居然是先全部算出来,再输出
#include<iostream>
using namespace std;
int fib[1000010] ;
int main(){
fib[1]=1;
fib[2]=1;
for(int i=3;i<=1000000;i++){
fib[i]=(fib[i-1]+fib[i-2])%1000;
}
int n;
cin >> n;
int num;
for(int i=1;i<=n;i++){
cin >> num;
cout << fib[num] << endl;
}
return 0;
}