首页
IT
登录
6mi
u
盘
搜
搜 索
IT
hdu 1297children
hdu 1297children
xiaoxiao
2021-03-25
60
#include <stdio.h>
int
main() {
int
n,i,j;
int
a[
1001
][
100
] =
{0}
; a[
1
][
1
] =
1
; a[
2
][
1
] =
2
; a[
3
][
1
] =
4
; a[
4
][
1
] =
7
;
for
(i =
5
;i <=
1000
;i ++)
for
(j =
1
;j <
100
;j ++) { a[i][j] += a[i-
1
][j] + a[i-
2
][j] + a[i-
4
][j]; a[i][j+
1
] += a[i][j] /
10000
; a[i][j] = a[i][j] %
10000
; }
while
(scanf(
"
%d
"
,&n) != EOF) {
for
(j =
99
;j >
0
;j --) {
if
(a[n][j] !=
0
) {
printf
(
"
%d
"
,a[n][j]);
break
; } } j--;
for
(;j >
0
;j--)
printf
(
"
d
"
,a[n][j]);
printf
(
"\n"
); }
return
0
; }
转载请注明原文地址: https://ju.6miu.com/read-38344.html
技术
最新回复
(
0
)