原创 PAT-1005.德才論(25)
#include<iostream> using namespace std; int N,L,H; struct stu {int B,C,D,Z; }; void order(stu s[],in
原创 PAT-1015.反轉鏈表(25)
感覺這是30道真題裏最難的一道了,比其他25分的題主要難在它的陷阱太多,題目並沒有明確指出,用了好久才AC,看到所有測試點都不紅了,激動。 經過多次嘗試,總結的陷阱主要有 : 1.看清題意!!!看清鏈表如何反轉!!! 2.首地址爲-1的
原创 PAT-2014.有理數四則運算(20)
#include<iostream> using namespace std; void gys(long long &a, long long &b); void Cout(long long k1,l
原创 PAT-1027.在霍格沃茨找零錢(20)
#include<iostream> using namespace std; int main() {int G[2],S[2],K[2],g,s,k,n;char x;cin>>G[0]>>x>>S[
原创 PAT-1030.有幾個PAT(25)
#include<iostream> using namespace std; int main() {char c;int num=0,p=0,t=0;while(1){c=getchar(); sw
原创 PAT-1025.插入與歸併(25)
#include<iostream> #include<algorithm> using namespace std; int N; int inser(int i,int A[],int B[]); i
原创 數據結構 P46-47 算法實現 順序棧的基本操作
#include <iostream> using namespace std; #define STACK_INIT_SIZE 100 //初始存儲容量 #define STACKINCERM
原创 數據結構 P49 棧的應用舉例-括號匹配的檢驗
#include <iostream> #include<conio.h> using namespace std; #define STACK_INIT_SIZE 100 //初始存儲容量 #d
原创 藍橋杯樣題-水仙花數(未完全解決)
#include<iostream> using namespace std; void huaduo(int N) {unsigned long long x,y=1,b,sum,num[100],a=
原创 數據結構 P38 算法實現 在帶頭結點的單鏈表的第i個元素插入元素e
/*程序*/ #include<iostream> using namespace std; struct node //創建節點 {int date; node *n
原创 數據結構 P62-62 算法實現 單鏈隊列的創建及基本操作
#include<iostream> using namespace std; typedef int QElemType; struct QNode //創建節點結構體 {
原创 數據結構 P48 算法實現 棧的應用舉例-數制轉換
#include <iostream> using namespace std; #define STACK_INIT_SIZE 100 //初始存儲容量 #define STACKINCERM
原创 數據結構 P64-65 算法實現 循環隊列的創建和基本操作
#include<iostream> using namespace std; typedef int QElemType; #define MAXQSIZE 100 struct linkqueue
原创 數據結構 P50 算法實現 棧的應用-行編輯程序
#include <iostream> #include<conio.h> using namespace std; #define STACK_INIT_SIZE 100 //初始存儲容量 #d