摘要: #include #include int main() { int n, i; __int64 d[40][2]={ {1, 2} }; /*d[i][0] indicate the sequence's last char is not O d[i][1] opposite*/ for... 阅读全文
posted @ 2015-03-13 22:24 StevenLuke 阅读(120) 评论(0) 推荐(0) 编辑
摘要: #include int main() { int n, i, k, b; __int64 a[50]={1, 2, 3}; for(i=3; ib ? 0 : a[b-k-1]); } } return 0;} 阅读全文
posted @ 2015-03-13 14:11 StevenLuke 阅读(105) 评论(0) 推荐(0) 编辑
摘要: a[2] = 6; #include int main() { int n, i; __int64 a[50]={3, 6, 6}; for(i=3; i<50; i++) a[i] = a[i-1] + a[i-2] * 2; while(~scanf("%d", &n)) { pr... 阅读全文
posted @ 2015-03-13 13:51 StevenLuke 阅读(127) 评论(0) 推荐(0) 编辑
摘要: #include int main() { int n, i; __int64 a[50]={1, 2, 3}; for(i=3; i<50; i++) { a[i] = a[i-1] + a[i-2]; } while(~scanf("%d", &n)) { printf("%I... 阅读全文
posted @ 2015-03-13 13:38 StevenLuke 阅读(102) 评论(0) 推荐(0) 编辑
摘要: 简单的递归。 我打算复试结束了再看算法。现在靠做题练习。 要用__int64,a[30][0]=113585929507107651,a[30][1]=41575339372525900 #include int main() { int n, i; __int64 a[34]={1, 3,... 阅读全文
posted @ 2015-03-13 13:23 StevenLuke 阅读(81) 评论(0) 推荐(0) 编辑
摘要: 最后数据会超过 2 ^32 - 1。 输出%用%%。 #include #include int main() { int n, i, k; __int64 a[21][2]={{1, 0}, {1, 0}, {2, 1}}; for(i=3; i<21; i++) { a[i][0] = ... 阅读全文
posted @ 2015-03-13 13:06 StevenLuke 阅读(117) 评论(0) 推荐(0) 编辑
摘要: PE了好多次。 ' * ‘'在格式化输入输出中的作用。 在scanf()中,用%*#,就代表读入一个#的数据,但不处理。比如: scanf("%c%*c%c", &a, &b); 输入ABC,此时,变量a='A', c='C'。而中间的'B',只是读入,没有做任何处理。 在printf()中,%... 阅读全文
posted @ 2015-03-13 11:33 StevenLuke 阅读(125) 评论(0) 推荐(0) 编辑
摘要: 第31行的getchar();如果写了就是WA,不写就是AC。 但是第九行的getchar();一定要写。 函数gets的原型为:char*gets(char*buffer); 在 stdio.h中定义,如果要程序中用到此函数需包含#include gets()函数用来从标准输入设... 阅读全文
posted @ 2015-03-13 00:24 StevenLuke 阅读(145) 评论(0) 推荐(0) 编辑