自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(12)
  • 收藏
  • 关注

原创 2-16-2 有些数的阶乘不算了

代码:#include #include using namespace std;int Re(int n);int main(){ double d=1; int n; while(1) { cout<<"输入要求阶乘的数:"; cin>>n; try { if(

2015-06-26 07:15:57 629 2

原创 在烟台的一年

到烟台大学一年了,今天想说点什么。从头说起吧,记得高考成绩出来的那时候,我很兴奋,因为问了班主任后知道自己是全班分最高的,那时候非常骄傲,回想复读的一年大概也是这种状态,很想显出自己,我就是带着这样的骄傲来到这个陌生的地方的。因为对之前的生活很不满意,把所有的一切不如意都归结在别人身上,认为自己做得很好,并没有什么错误,所以在选择学校的时候很刻意的选了外省的学校,希望能脱离这个我认为充满不

2015-06-25 22:55:48 1988

原创 2-16-1 平方根中的异常

代码:#include #include #include using namespace std;int main(){ int n; cout<<"输入要开方的数:"; cin>>n; try { if(n<0) throw n; } catch(int) {

2015-06-25 22:47:09 545

原创 补充项目-链表类

代码:#include using namespace std;class Student //结点类{public: Student(int n,double s):num(n), score(s), next(NULL) {} ~Student(); Student *next; //指向下一个结点 int num; double sc

2015-06-23 22:35:54 409

原创 吹毛求疵-命名空间要解决的问题

代码:以下为正确的代码,验证了局部变量优先于命名空间中同名的实体。#include using namespace std;int main(){ char endl[]="abc"; cout<<endl; return 0;}测试内容:验证命名空间要解决的问题--命名空间解决标识符在不同库(我理解为不同的命名空间)以及程序全局

2015-06-21 22:37:04 507 2

原创 吹毛求疵-命名空间的使用

代码:#include using namespace std; //命名空间中有一个distance(两个参数)namespace mydistance{ void distance(int a) //在自定义命名空间中定义带一个参数的distance函数 { cout<<"It's my distance!"<<endl; }}usin

2015-06-20 09:43:24 692

原创 吹毛求疵-throw与catch函数

代码:#include #include using namespace std;void f3();int main(){ void f1(); try { f1(); } catch(char) { cout<<"main"<<endl; } return 0;}void f1()

2015-06-19 08:54:10 600

原创 2-14-1(1) 小玩文件

问题及代码:#include #include #include using namespace std;int main(){ fstream file; file.open("abc.txt", ios::in); // (2) if(!file) { cout<<"abc.txt can’t open."<<endl; e

2015-06-11 23:18:36 341

原创 2-14-1(2) 小玩文件

问题及代码:#include #include #include using namespace std;int main(){ fstream outfile,infile; infile.open("abc.txt",ios::in); // (1) if(!infile) { cout<<"Can’t open the file."<<e

2015-06-11 23:10:59 441

原创 2-13-3 立体类族共有的抽象类

问题及代码:#include using namespace std;class CSolid{public: virtual double Area()=0; virtual double Volume()=0;};class CCube:public CSolid{public: CCube(double s=1):Si

2015-06-03 09:15:03 439

原创 2-13-2 形状类族的中的纯虚函数

问题及代码:#include using namespace std;class Shape{public: virtual double area()=0;};class Circle:public Shape{public: Circle(double R):r(R){}; double area();protect

2015-06-03 08:37:38 714

原创 2-13-1 动物怎么叫

问题及代码:#include #include using namespace std;class Animal{public: virtual void cry()=0; Animal(string n):Name(n){};protected: string Name;};class Mouse:public Animal{

2015-06-03 08:16:52 357

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除