您的位置:首页 > 其它

1613-3-傅溥衍 总结《2016年11月19日》【连续第五十天总结】

2016-11-20 00:24 155 查看
标题:继承
关键词:人类设计
内容: 
A今日完成情况

1. 人类设计50%

B具体内容

人类设计

#include<iostream>
#include<windows.h>
#include<string.h>
using namespace std;
class person
{
char *name;
char sex;
char pid[19];
int weight;
int high;
public:
person();
person(char *n,char s,char *p,int w,int h);
void change_data(char *n,char s,char *p,int w,int h);
void walking(int k,int v);
void hearing(char *sentence);
void speek(int n);
void writing();
void print();
void out(int a);
~person();
};
void person::walking(int k,int v)
{
cout<<"\n"<<name<<"水平直线行走"<<k<<"步"<<endl;
for(int i=0;i<k;i++)
{
cout<<' '<<"o _ o";
Sleep(1000/v);
cout<<"\b\b\b";

}
}
void person::hearing(char *sentence)
{
cout<<endl<<sentence<<endl;
char *p=new char[strlen(sentence)+1];
strcpy(p,sentence);
char *pp=p;
while(*p)
{
if(*p>='a'&& *p<='z')
*p='A'+(*p-'a'+0);
else if(*p>='A'&& *p<='Z')
*p='a'+(*p-'A');

p++;
}
cout<<pp<<endl;
delete pp;
}
void person::speek(int n)
{
if(n>1999999999)
cout<<"devc++无法处理"<<endl;
else
{
int a=n/1000000000,b=(n%1000000000)/1000000;
int c=(n%1000000)/1000,d=n%1000;
if(a!=0)
{ out(a);
cout<<"billion";
}
if(b!=0)
{ out(b);
cout<<"million";
}
if(c!=0)
{ out(c);
cout<<"thousand";
}
if(d!=0)
{
if(d<100&&(a!=0||b!=0||c!=0))
cout<<"and";

}
cout<<endl;
}
}

void person::writing()
{
cout<<"啊啊啊啊啊"<<endl;
}
int main()
{
person Jack("James Chen",'M',"5923666658147520258",160,180);
Jack.print();
Jack.walking(20,4);
Jack.hearing("Hi! you are silly");
Jack.speek(1006);
cout<<endl;
Jack.writing();
return 0;
}

C明日计划

A 人类设计

B 为什么需要继承
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐