摘要: 余数里面的一条公式:(a+b)%3 = (a%3+b%3)%3 1 #include <iostream> 2 using namespace std; 3 int f[1000001]; 4 int main() { 5 int n; 6 f[0] = 7; 7 f[1] = 11; 8 for (int i = 2; i <= 1000000; i++) 9 f[i] = (f[i-1]%3 + f[i-2]%3)%3;10 while(cin>>n) {11 if (n < 2) cout<<"no"<<en 阅读全文
posted @ 2012-04-24 16:45 SkyHacker 阅读(891) 评论(0) 推荐(0) 编辑