作业社区
探索学习新天地,共享知识资源!
北城半夏4806197 的学生作业:
#include using namespace std; class mytime { private: int hour; int min; int sec; public: void setHour(const int _hour); void setMin(const int _min); void setSec(const int _sec); void output(); }; void mytime::setHour(const int _hour) { hour = _hour; return; } void mytime::setMin(const int _min) { min = _min; } void mytime::setSec(const int _sec) { sec = _sec; } void mytime::output() { cout
+88
北城半夏4806197 的学生作业:
06so.c #include #include"06so.h" char *cpy(char *a,char *b) { char *copy = b; while(*a !='\0') { *(b++) = *(a++); } *b = '\0'; return copy; } char *cat(char *a,char *b) { char *coat = a; while(*a != '\0') { a++; } while(*b !='\0') { *(a++) = *(b++); } *a = '\0'; return coat; } 06so.h #ifndef __06SO_H_ #define __06SO_H_ #ifdef __cplusplus extern "C"{ #endif extern char *cpy(char *a,char *b); extern char *cat(char *a,char *b); #ifdef __cplusplus } #endif #endif main.cpp #include"06so.h" #include using namespace std; int main(int argc, const char *argv[]) { char a[] = "hello"; char b[] = {0}; cout
+76
北城半夏4806197 的学生作业:
#include using namespace std; int my_swap(int &a,int &b) { int t = a; a = b; b = t; } int my_swap(float &a,float &b) { float t = a; a = b; b = t; } int my_swap(string &a,string &b) { string t = a; a = b; b = t; } int main() { int i1 = 10,i2 = 20; my_swap(i1,i2); cout
+91