visual c++的高手进,江湖救急啊,考试急用,拜托拜托了,急急急~~~

如果满意,再加送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题已解决,请大家帮帮,后两题,谢谢谢谢~~

9.
#include <iostream>
using namespace std;

void str_connect(char* str1,char*str2)
{
int i;
for(i=0;str1[i]!=0;i++);
for(int j=0;str2[j]!=0;j++,i++)
str1[i]=str2[j];
str1[i]='\0';
}
int main()
{
char a[20],b[20];
cin>>a>>b;
str_connect(a,b);
cout<<a<<endl;
cin>>a;
return 1;
}
10.#include<iostream>
using namespace std;

const double PI = 3.14159;

//Circle类
class Circle
{
public:
Circle(double r) : radius(r) {} //构造函数

//计算圆面积
double getArea()
{
return PI*radius*radius;
}
private:
double radius;//圆的半径
};

//Cylinder类
class Cylinder : public Circle
{
public:
Cylinder(double r, double h) : Circle(r), height(h) {} //派生类的构造函数

//计算体积
double getVolume()
{
return height*getArea();
}
private:
double height;//圆柱的高
};

//测试程序
int main(int argc, char *argv[], char *env[])
{
Circle test_circle(10);
Cylinder test_cylinder(10, 20);

cout << "圆面积:" << test_circle.getArea() << endl;
cout << "圆柱底面积:" << test_cylinder.getArea() << endl;
cout << "圆柱体积:" << test_cylinder.getVolume() << endl;

return 0;
}

希望能帮到你
温馨提示:答案为网友推荐,仅供参考
第1个回答  2011-01-01
去图书馆找本程序员面试宝典吧,这都是一些面试题.本回答被网友采纳
第2个回答  2011-01-03
给你两个参考好了……

#include<iostream>
#include<cmath>
using namespace std;
int main()
{
int a23,a28,a33,i,d,n=0;
while(cin>>a23>>a28>>a33>>d&&a23!=-1)
{
n++;
for(i=d+1;i<=d+21252;i++)
if((i-a23)%23==0&&(i-a28)%28==0&&(i-a33)%33==0) break;
cout<<"Case "<<n<<": the next triple peak occurs in "<<i-d<<" days."<<endl;
}
return 0;
}

#include<iostream>
#include<cmath>
using namespace std;
void main()
{
int m,n,p,q,num=0;
while(cin>>m>>n>>p>>q&&m!=-1)
{
num++;
int i,flag=0;
for(i=0;i<p;i++)
{
if((i-m)%23==0&&(i-n)%28==0&&(i-p)%33==0&&i>q)
{
cout<<"Case "<<num<<": the next triple peak occurs in "<<i-q<<" days."<<endl,flag++;
}
if(flag>0) break;
}
if(flag==0)
{
for(i=p;(i-m)%23!=0||(i-n)%28!=0||i<=q;i+=33);
cout<<"Case "<<num<<": the next triple peak occurs in "<<i-q<<" days."<<endl;
}
}
}
第3个回答  2011-01-02
留个邮箱吧,我发你
第4个回答  2011-01-02
这么多题才给80分!呵呵,自己慢慢写吧。
第5个回答  2011-01-03
现在的孩子真好混成绩!
第6个回答  2011-01-02
yuan?I'm liang~~~
相似回答