题目内容:求1!+2!+3!+4!+……+n!的结果。输入描述:输入不多于50个正整数的数据n(1#include #include using namespace std;int main(int argc,char * argv[]){ vector n(50); int sum, p, m; int num = 0; while (num >m; if (m>= 1 && m12) { cout << "The input should be more than 1 and less than 12"; } if (cin.ge Read More
posted @ 2013-10-20 23:18 源子陌 Views(2504) Comments(0) Diggs(1) Edit
题目内容:编写程序计算两个整数的差。输入描述:输入数据含有不超过50个整数对,每个整数队及每对整数的运算结果都不会超过231或-231。输出描述:对于每次读入的一对整数,输出前者减去后者的差。每个结果以回车结束。代码示例:#include "stdafx.h"#include #include #include using namespace std;struct Discrepancy{ int minuend; int subtrahend;};int main(int argc, char * argv[]){ vector d(50); int num = 0; i Read More
posted @ 2013-10-20 22:02 源子陌 Views(477) Comments(0) Diggs(1) Edit