题目:已知存在两个非递减的有序链表List1和List2,现在需要你将两个链表合并成一个有序的非递增序列链表List3,请用C++编码实现.(所有链表均为单链表结构) 思路:此处链表是否都有表头并没有规定. 1:将链表List1和List2合并成一个非递减有序链表List3: 2:再将链表List3进行逆序,即可. #include <iostream>using namespace std;typedef int ElemType;typedef struct LNode{ ElemType…
#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…
#include <iostream> using namespace std; void showmenu(void) { cout<<"Please enter one of the following choices:\n" "c) carnivore p) pianist\n" "t) tree g) game\n"; } void ak(void) { cout<<"Please enter…
#include <iostream> #include <cctype> using namespace std; const int MAXSIZE=10; int main() { double dd[MAXSIZE]; double donation; double aver=0; int num=0; int i=0; while(i<MAXSIZE && cin>>donation && !isdigit(donatio…
#include <iostream>#include <cctype>using namespace std;int main(){ char ch; while((ch=cin.get())!='@') {  if(isdigit(ch))   continue;  else if(islower(ch))   ch-='z'-'Z';  else if(isupper(ch))   ch+='z'-'Z';  cout<<ch; } system("pa…