如果满意,再加送80分,各位高手帮帮忙哦,先谢谢各位了~~
请用visual c++编程:
1.输出1-100之间能被7整除的数。
2.1!+2!+……+20!。
3.求100~999中的水仙花数。所谓水仙花数是指一个三位数,它的每位数字的立方之和等于该数。例如,因为153=13+53+33,所以153为水仙花数。
4.根据π/4=1-1/3+1/5-1/7+……求π的近似值,直到最后一项的值小于0.000001为止。
5.编写程序输出菲波那切数列的前20项。即前两项为1,以后每一项为前两项之和。
6.编写一段程序,从键盘输入字符串s2,然后s2中的字符拷贝到字符串s1中,不用strcpy函数。
7.使用重载函数编程序分别把两个数和三个数从大到小排列。
8.输入十个数,按从小到大的顺序排序并输出。
9.编写一个函数str_connect,将一个字符串str2接到另一个字符串str1的后面。
10.设计一个类circle,包含一个radius成员,由circle类派生出一个圆柱类cylinder,包含height成员,要求:
(1)每个类都用构造函数初始化对象;
(2)两个类中都有getArea()函数计算面积;
(3)能计算圆柱体的体积;
(4)能输出相应的值。
11.定义一个时间类Time,要求满足如下要求。(类Time包括私有数据成员hour、min和sec)
(1)定义一个带缺省参数的构造函数;
(2)重载<<运算符,以hh:mm:ss的格式输出时分秒;
(3)能对某一时间进行加一秒的操作;
12.定义一个复数类CComplex,包含两个数据成员real和image,实现下列功能。
(1)定义带有两个默认参数的构造函数;
(2)重载“+”运算符实现复数的输出;
(3)重载“<<”运算符实现复数的输出;
(4)编写主程序,测试各个函数。
邮箱:[email protected]
前10题已解决,请大家帮帮,后两题,谢谢谢谢~~