作业
csx0987
这个作者很懒,什么都没留下…
展开
-
第一章第8题
C++#include "iostream"using namespace std;void sort(int &a,int &b);int main(int argc, char const *argv[]){ int x=0,y=0; cin>>x>>y; sort(x,y); return 0;}void sort(int &a,int &b){ i原创 2015-03-28 01:17:50 · 305 阅读 · 0 评论 -
学生信息
#include "iostream"#include "string"#include "list"using namespace std;class Student{protected: string Name; string Num; string Major; public: Student(){} Student(strin原创 2015-05-26 20:56:19 · 265 阅读 · 0 评论 -
Date_Time(继承)
#include "iostream"using std::cin;using std::cout;using std::endl;using std::istream;using std::ostream;class Time{protected: int hour; int minute; int second;public: Time(int h =原创 2015-05-06 18:29:52 · 358 阅读 · 0 评论 -
伪String
#ifndef _STRING_#define _STRING_#include "iostream"using std::ostream;using std::istream;class String{private: char *s;public: String(); String(int n); String(const char *str); String原创 2015-04-22 14:24:05 · 219 阅读 · 0 评论 -
第2章第4题
C++#include #include "student.h"#include "student.cpp"/* run this program using the console pauser or add your own getch, system("pause") or input loop */int main(int argc, char** argv) { st原创 2015-03-28 02:19:08 · 289 阅读 · 0 评论 -
类 思维导图
原创 2015-04-19 23:18:26 · 287 阅读 · 0 评论 -
第2章第5题
C++#include #include "arry_max.h"#include "arry_max.cpp"/* run this program using the console pauser or add your own getch, system("pause") or input loop */int main(int argc, char** argv) {原创 2015-03-28 02:24:36 · 257 阅读 · 0 评论 -
第2章第6题
C++#include #include "cuboid.h"#include "cuboid.cpp"/* run this program using the console pauser or add your own getch, system("pause") or input loop */int main(int argc, char** argv) { for原创 2015-03-28 02:27:16 · 336 阅读 · 0 评论 -
第一章第9题
C++#include "iostream"using namespace std;templatevoid sort(T &a,T &b,T &c){ T min; T max; T mi; if(a<b) { min=a; max=b; if(c>b) { max=c; mi=b; } else if(c<a) { min原创 2015-03-28 01:19:45 · 446 阅读 · 0 评论 -
第2章第2题
C++#includeusing namespace std;class Time{private: int hour; int minute; int sec;public: void fcin() { cin>>hour>>minute>>sec; } void fcout() { cout<<"hour="<<hour<<endl; cout<原创 2015-03-28 02:15:07 · 335 阅读 · 0 评论 -
第一章第14题
C++#include "iostream"using namespace std;templatevoid sort(int n,T a[]){ int i=0; int j=0; for(i=0;i<n-1;i++) { for(j=i+1;j<n;j++) { if(a[i]>a[j]) { T temp; temp=a[i];原创 2015-03-28 02:11:10 · 233 阅读 · 0 评论 -
第一章第11题
C++#include "iostream"#include "string"using namespace std;void sprin(string a);int main(int argc, char const *argv[]){ string st1; cin>>st1; cout<<st1<<endl; sprin(st1); return 0;}v原创 2015-03-28 01:55:59 · 281 阅读 · 0 评论 -
第一章第7题
C++ P35 7原创 2015-03-28 01:08:45 · 307 阅读 · 0 评论 -
第一章第12题
#include "iostream"#include "string"using namespace std;int main(int argc, char const *argv[]){ string st[5]; for(int i=0;i<5;i++) { cin>>st[i]; } int i=0; int j=0; for(i=0;i<4;i++)原创 2015-03-28 01:58:34 · 286 阅读 · 0 评论 -
第一章第10题
C++#include "iostream"#include "string"using namespace std;int main(int argc, char const *argv[]){ string st1,st2; cin>>st1>>st2; cout<<"st1="<<st1<<" "<<"st2="<<st2<<endl; st1=st1+st2;原创 2015-03-28 01:53:04 · 183 阅读 · 0 评论 -
第一章第13题
C++#include "iostream"using namespace std;void sort(int n,int a[]);void sort(int n,char a[]);void sort(int n,double a[]);int main(int argc, char const *argv[]){ int a[4]; for(int i=0;i<4原创 2015-03-28 02:08:09 · 373 阅读 · 0 评论 -
第2章第3题
C++#includeusing namespace std;class Time{private: int hour; int minute; int sec;public: void fcin(); void fcout();};//void Time::fcin();//void Time::fcout();int main(){ Time t1;原创 2015-03-28 02:16:13 · 673 阅读 · 0 评论 -
扩展程序:创建一个三角形类
//扩展程序:创建一个三角形类//修改create_object函数,使得程序支持三角形的创建//和求面积、打印等操作#include #include "cmath"using namespace std;class Shape { public: virtual double getArea() const =0; virtual void pr原创 2015-05-19 20:57:30 · 379 阅读 · 0 评论