Poll Question Two (C + +)

Source: Internet
Author: User

Output Example data range: 1 <= m,n < 100. A number of
voting question two
difficulty level: C; run time limit: 1000ms; operating space limit: 51200KB; code length limit: 2000000B
Question Description /td>

Ouyangwen and Yi等 campaign chairman, Wangliangsen is responsible for recount, a total of m+n, the result Ouyangwen win, known Ouyangwen and Yi等 respectively obtained m-ticket and N-ticket (m>n). Now, please calculate how many Ouyangwen the number of votes in the recount process is always more than the number of yi等 votes.

input
line, including two numbers, respectively, for  m  and  n 
Output
that represents the number of scenarios that meet the requirements of the topic.
Input Example
5 3
14
Other instructions

#include <iostream>
using namespace Std;
Long Long f[101][101];
int main ()
{
Long Long m,n;
scanf ("%lld%lld", &m,&n);
F[1][0]=1;
for (int i=1;i<=m;i++)
{
for (int j=0;j<=n;j++)
{
if (i>j && (i!=1 | | j!=0)) F[I][J]=F[I-1][J]+F[I][J-1];
else if (i<=j) break;
}
}
printf ("%lld", F[m][n]);
return 0;
}

Poll Question Two (C + +)

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.