//
// main.c
// easy
//
// Created by 戴志扬 on 16/7/1.
// Copyright © 2016 年 sky.dai. All rights reserved.
// easy 24 繁殖问题
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#define Month 51
int main()
{
int n;
int num[ 6 ] = { 1 , 0 }; // 存放 1-6 个月大的小鼠的数量
int totalNum[ Month ] = { 0 , 1 , 0 }; // 表示第 i 个月总的小鼠的数量
for ( int i= 2 ;i<= Month ;++i)
{
num[ 5 ] = num[ 4 ];
num[ 4 ] = num[ 3 ];
num[ 3 ] = num[ 2 ];
num[ 2 ] = num[ 1 ];
num[ 1 ] = num[ 0 ];
num[ 0 ] = num[ 2 ]+num[ 3 ]+num[ 4 ];
totalNum[i] = num[ 0 ]+num[ 1 ]+num[ 2 ]+num[ 3 ]+num[ 4 ]+num[ 5 ];
}
while ( scanf ( "%d" ,&n)== 1 )
printf ( "%d\n" ,totalNum[n]);
}
// main.c
// easy
//
// Created by 戴志扬 on 16/7/1.
// Copyright © 2016 年 sky.dai. All rights reserved.
// easy 24 繁殖问题
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#define Month 51
int main()
{
int n;
int num[ 6 ] = { 1 , 0 }; // 存放 1-6 个月大的小鼠的数量
int totalNum[ Month ] = { 0 , 1 , 0 }; // 表示第 i 个月总的小鼠的数量
for ( int i= 2 ;i<= Month ;++i)
{
num[ 5 ] = num[ 4 ];
num[ 4 ] = num[ 3 ];
num[ 3 ] = num[ 2 ];
num[ 2 ] = num[ 1 ];
num[ 1 ] = num[ 0 ];
num[ 0 ] = num[ 2 ]+num[ 3 ]+num[ 4 ];
totalNum[i] = num[ 0 ]+num[ 1 ]+num[ 2 ]+num[ 3 ]+num[ 4 ]+num[ 5 ];
}
while ( scanf ( "%d" ,&n)== 1 )
printf ( "%d\n" ,totalNum[n]);
}