- 博客(4)
- 收藏
- 关注
原创 自定义日期时间转UNIX时间截
#include "stdafx.h"#include #include #include #include using namespace std;#include #include #include /*struct tm{ int tm_sec; //记录当前时间 秒, 0-59 int tm_min; //记录当前时间 分 0-59 int tm_hour
2009-11-26 13:44:00 364
原创 自编strlen()函数,并用它递归调用编写revers(S)函数,给字符串S倒序
#include using namespace std;int strlen1(char *p){ int i=0; while ( (*p)!=NULL ) { p++; i++; } return i;} void revers(char *p){ char s1[100]=""; int len; while ( (*p)!=NULL ) { len=strl
2009-07-27 14:59:00 615
原创 设计一个基类,从基类派生圆,从圆派生圆柱,设计成员函数输出它们的面积和体积
#include #include using namespace std;#define pi 3.14class point{protected: int x1, y1;public: point(int a, int b) { x1=a; y1=b; }};class circle:public point{protected: int x2, y2;public: circle
2009-07-09 13:42:00 8342
原创 建立一个动态数组,赋值/显示并删除。
#includeusing namespace std;void main(){ int len; cout cin>>len; int *p=new int[len]; for (int i=0; i { cout cin >> *(p+i); } for (int j=0; j { cout } delete[] p;}
2009-07-08 11:07:00 839
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人