17 _ 1_2 recursion Function

Source: Internet
Author: User

[Cpp]/** Copyright and version statement of the program section * Copyright (c) 2013, student * All rightsreserved from computer College of Yantai University. * file name: date. cpp * OPERATOR: Ji Zilong * Completion Date: July 15, March 1, 2013 * version: v1.0 * input Description: year, month, and day * Problem description: The output date corresponds to the day of the year * output: day */# include <iostream> using namespace std; long fac (int n); int main () {int n, I; cout <"Input n :"; cin> n; I = fac (n); cout <I <endl; return 0;} long fac (int n) {if (n = 1) return 1; else return (2 * N-1) * fac (n-1);} running result:

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.