S-Dominoes paved squares (second season water)

Source: Internet
Author: User

Description

In a rectangular square of 2xn, fill the squares with a 1x2 domino, enter N, and output the total number of paving schemes. For example, when n=3, for 2x3 squares, the Domino placement scheme has three kinds, such as:

Input

The input data consists of multiple lines, each containing an integer n, indicating that the size of the rectangular square of the test instance is 2xn (0<n<=50).

Output

For each test instance, output the total number of placement scenarios, one row for each instance output.

Sample Input

1 3 2

Sample Output

1 3 2 water problem, same as a small bee
#include <iostream>using namespaceStd;__int64 s[ -];voidf () {s[0]=0; s[1]=1; s[2]=2;  for(intI=3;i< -; i++) S[i]=s[i-1]+s[i-2];}intMain () {intN;    f ();  while(cin>>n) cout<<s[n]<<Endl; //System ("pause");    return 0; }

S-Dominoes paved squares (second season water)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.