文件名称:cata
介绍说明--下载内容均来自于网络,请自行研究使用
▲问题描述:
(1) 设计一个表示高精度整数的模板类,它支持对任意大整数的输入、输出和四则运算(+、-、*、/),其中除法运算应输出所得的商和余数。
(2) 用上述高精度整数的模板类,计算大整数组合数和Catalan数的精确值。
组合数C(m,n)=m! / (n!*(m-n)!)
Catalan数定义为:C(n)=C(2*n,n)/(n+1)
▲编程任务:
给定大整数m和n,计算C(m,n)和C(m)的精确值。
▲数据输入:
由文件input.txt给出输入数据。第一行有2 个正整数m和n。
▲结果输出:
将计算出的的精确值输出到文件output.txt。文件的第一行是组合数的精确值,第2 行是C(m)的精确值。
▲输入文件示例 输出文件示例
input.txt output.txt
5 3 10
42
-A descr iption of the problem:
(1) design a template class high precision integer, its support for arbitrary integer input, output and four operations (+,-,*, /), the division should output the quotient and remainder.
(2) by a template class the high-precision integer values, accurate calculation of large integer combinations of numbers and Catalan numbers.
Composite number C (m, n)/(=m! N!* (m-n)!)
The Catalan number is defined as: C (n) =C (2*n, n)/(n+1)
▲ programming tasks:
Given the large integer m and N, calculation of C (m, n) and C (m) the exact value.
▲ data input:
Input.txt documents presented by the input data. The first line has 2 positive integers m and n.
▲ result output:
To calculate the exact value of the output to a file output.txt. The first line of the file is the exact value of the number of combinations, the second line is the exact value of C (m).
▲ input file sample output file example
Input.txt output.txt
5310
42
(1) 设计一个表示高精度整数的模板类,它支持对任意大整数的输入、输出和四则运算(+、-、*、/),其中除法运算应输出所得的商和余数。
(2) 用上述高精度整数的模板类,计算大整数组合数和Catalan数的精确值。
组合数C(m,n)=m! / (n!*(m-n)!)
Catalan数定义为:C(n)=C(2*n,n)/(n+1)
▲编程任务:
给定大整数m和n,计算C(m,n)和C(m)的精确值。
▲数据输入:
由文件input.txt给出输入数据。第一行有2 个正整数m和n。
▲结果输出:
将计算出的的精确值输出到文件output.txt。文件的第一行是组合数的精确值,第2 行是C(m)的精确值。
▲输入文件示例 输出文件示例
input.txt output.txt
5 3 10
42
-A descr iption of the problem:
(1) design a template class high precision integer, its support for arbitrary integer input, output and four operations (+,-,*, /), the division should output the quotient and remainder.
(2) by a template class the high-precision integer values, accurate calculation of large integer combinations of numbers and Catalan numbers.
Composite number C (m, n)/(=m! N!* (m-n)!)
The Catalan number is defined as: C (n) =C (2*n, n)/(n+1)
▲ programming tasks:
Given the large integer m and N, calculation of C (m, n) and C (m) the exact value.
▲ data input:
Input.txt documents presented by the input data. The first line has 2 positive integers m and n.
▲ result output:
To calculate the exact value of the output to a file output.txt. The first line of the file is the exact value of the number of combinations, the second line is the exact value of C (m).
▲ input file sample output file example
Input.txt output.txt
5310
42
(系统自动生成,下载前可以参看下载内容)
下载文件列表
cata.cpp