#include <iostream>using namespace std;char *mystrcat(const char *str1,const char *str2){ char *dst; dst=(char *)malloc(sizeof(str1)+sizeof(str2)); char *start=dst; while(*dst=*str1) {  dst++;  str1++; } while(*dst=*str2) {  dst++;  str2++; } *dst='…
#include <iostream>using namespace std;int mystrcmp(const char *str1,const char *str2){ assert(*str1!='\0' && *str2!='\0'); while(*str1!='\0' && *str2!='\0' && *str1==*str2) {  str1++;  str2++; } return *str1-*str2;}int main(…
//考察点1:输入参数加const int Mystrlen(const char *str) {//考察点2:断言字符串非0 assert(str!=NULL); int len=0;//考察点3:一定要初始化 while((*str++)!='\0') { len++; } return len; }…
char *Mystrcpy(char *strDest, const char *strSrc) //考察点1:将源字符串加const,表明为输入参数 {//考察点2:对源地址和目的地址的非0断言 assert((strDset!=NULL) && (strSrc!=NULL)); char *address=strDest; while((*strDest++=*strSrc++)!='\0') return address;//考察点3:为了实现链式操作,返回目的地址 }…
#include <iostream> #include <fstream> #include <cstdlib> #include <string> using namespace std; struct patron { double mon; string name; }; int main() { int num,count1=0,count2=0; ifstream fin; char filename[20]; cout<<"…
#include <iostream> #include <fstream> #include <cstdlib> const int SIZE=20; using namespace std; int main() { char filename[SIZE]; char ch; ifstream inFile;//inFile 是有一个ifstream对象 cout<<"Enter name of file: "; cin.get(fi…
#include <iostream> #include <string> #include <cctype> using namespace std; int main() { string words; int yy=0; int fy=0; int other=0; cout<<"Enter words (q to quit):\n"; while(cin>>words) { if(isalpha(words[0]))…
#include <iostream> #include <string> using namespace std; const int MSIZE=100; struct juankuan { string name; double mon; }; int main() { int num; (cin>>num).get(); int *c1=new int[num];//存储捐款超过10000的捐款个体 int count1=0;//记录捐款超过10000的个数 i…
#include <iostream> using namespace std; const double N1=35000; const int N2=15000; const int N3=5000; int main() { double salary; double sui=0; cout<<"Enter the salary: "; while(cin>>salary && salary>=0) { if(salary…
#include <iostream> using namespace std; const int strsize=30; const int BOPSIZE=5; void showmenu() { cout<<"Benevolent Order of Programmers Report\n" "a. display by name b. display by title\n" "c. display by bopname d…