├── Algorithm_Experiment ├── First_Experiment │ ├── Percolation.java │ ├── PercolationStats.java │ ├── QuickFind.java │ └── WeightedQuickUnion.java ├── Second_Experiment │ ├── Bottomup_MergeSort.java │ ├── CompareMain.java │ ├── Insertion_Sort.java │ ├── QuickSort_With_D3P.java │ ├── Random_QuickSort.java │ └── Topdown_MergeSort.java ├── Three_Experiment │ ├── Route.java │ ├── indexPQ.java │ └── usa.txt ├── 实验题目.docx └── 算法实验报告.pdf ├── Course_Design_Fifth ├── .idea │ ├── .gitignore │ ├── Course_Design_Fifth.iml │ ├── misc.xml │ └── modules.xml ├── CMakeLists.txt ├── Readme.md ├── TXT文件 │ ├── BookList.txt │ ├── Manager.txt │ ├── Reader.txt │ └── ReaderInfoRecord.txt ├── cmake-build-debug │ ├── BookList.txt │ ├── CMakeCache.txt │ ├── CMakeFiles │ │ ├── 3.17.5 │ │ │ ├── CMakeCCompiler.cmake │ │ │ ├── CMakeCXXCompiler.cmake │ │ │ ├── CMakeDetermineCompilerABI_C.bin │ │ │ ├── CMakeDetermineCompilerABI_CXX.bin │ │ │ ├── CMakeRCCompiler.cmake │ │ │ ├── CMakeSystem.cmake │ │ │ ├── CompilerIdC │ │ │ │ ├── CMakeCCompilerId.c │ │ │ │ └── a.exe │ │ │ └── CompilerIdCXX │ │ │ │ ├── CMakeCXXCompilerId.cpp │ │ │ │ └── a.exe │ │ ├── CMakeDirectoryInformation.cmake │ │ ├── CMakeOutput.log │ │ ├── Course_Design_Fifth.dir │ │ │ ├── CXX.includecache │ │ │ ├── DependInfo.cmake │ │ │ ├── build.make │ │ │ ├── cmake_clean.cmake │ │ │ ├── depend.internal │ │ │ ├── depend.make │ │ │ ├── flags.make │ │ │ ├── link.txt │ │ │ ├── linklibs.rsp │ │ │ ├── main.cpp.obj │ │ │ ├── objects.a │ │ │ ├── objects1.rsp │ │ │ └── progress.make │ │ ├── Makefile.cmake │ │ ├── Makefile2 │ │ ├── TargetDirectories.txt │ │ ├── clion-environment.txt │ │ ├── clion-log.txt │ │ ├── cmake.check_cache │ │ └── progress.marks │ ├── Course_Design_Fifth.cbp │ ├── Course_Design_Fifth.exe │ ├── Makefile │ ├── Manager.txt │ ├── Reader.txt │ ├── ReaderInfoRecord.txt │ ├── Testing │ │ └── Temporary │ │ │ └── LastTest.log │ └── cmake_install.cmake └── main.cpp ├── IOT_Experiment ├── ACL配置实验报告.pdf ├── DES实验报告.pdf ├── Geth搭建ETH实验报告.pdf ├── MD5算法实验报告.pdf ├── 凯撒密码实验报告.pdf ├── 椭圆曲线算法实验报告.pdf └── 源代码 │ ├── DES.cpp │ ├── ECC.c │ ├── IOT_md5.java │ └── Kaisa.cpp └── README.md /Algorithm_Experiment/First_Experiment/Percolation.java: -------------------------------------------------------------------------------- 1 | package First_Experiment; 2 | 3 | public class Percolation { 4 | private int N,count,choice; 5 | private boolean[] sites; 6 | private WeightedQuickUnion WQU; 7 | private QuickFind QF; 8 | public Percolation(int n,int choice) { 9 | this.N = n; 10 | this.choice=choice; 11 | this.sites = new boolean[N*N+2]; 12 | sites[0] = true; //初始化所有格点为blocked 13 | sites[N*N+1] = true; //开头和末尾为open 14 | count = 0; 15 | WQU = new WeightedQuickUnion(N*N+2); 16 | QF=new QuickFind(N*N+2); 17 | } 18 | //将节点变为open节点 19 | public void Open(int row, int col) { 20 | if(row < 1 || row > N || col < 1 || col > N) 21 | throw new IndexOutOfBoundsException("Index Out Of Bounds Exception"); 22 | int a=0; 23 | if(sites[(row-1)*N+col]) return; 24 | sites[(row-1)*N+col] = true; 25 | count++; 26 | 27 | if(choice==2){ 28 | //如果在第一行,将其与开头连接 29 | if(row == 1) 30 | WQU.Union(0,(row-1)*N+col); 31 | //如果在最后一行,将其与结尾连接 32 | if(row == N) 33 | WQU.Union((row-1)*N+col,N*N+1); 34 | 35 | //连接上下左右的open节点 36 | if(col != 1 && sites[(row-1)*N+col-1]) 37 | WQU.Union((row-1)*N+col,(row-1)*N+col-1); 38 | if(col != N && sites[(row-1)*N+col+1]) 39 | WQU.Union((row-1)*N+col,(row-1)*N+col+1); 40 | if(row != 1 && sites[(row-2)*N+col]) 41 | WQU.Union((row-1)*N+col,(row-2)*N+col); 42 | if(row != N && sites[row*N+col]) 43 | WQU.Union((row-1)*N+col,row*N+col); 44 | }else if(choice==1){ 45 | if(row == 1) 46 | QF.Union(0,(row-1)*N+col); 47 | //如果在最后一行,将其与结尾连接 48 | if(row == N) 49 | QF.Union((row-1)*N+col,N*N+1); 50 | 51 | //连接上下左右的open节点 52 | if(col != 1 && sites[(row-1)*N+col-1]) 53 | QF.Union((row-1)*N+col,(row-1)*N+col-1); 54 | if(col != N && sites[(row-1)*N+col+1]) 55 | QF.Union((row-1)*N+col,(row-1)*N+col+1); 56 | if(row != 1 && sites[(row-2)*N+col]) 57 | QF.Union((row-1)*N+col,(row-2)*N+col); 58 | if(row != N && sites[row*N+col]) 59 | QF.Union((row-1)*N+col,row*N+col); 60 | } 61 | } 62 | //判断节点是否为open节点 63 | public boolean IsOpen(int row, int col) { 64 | if(row < 1 || row > N || col < 1 || col > N) 65 | throw new IndexOutOfBoundsException("Index Out Of Bounds Exception"); 66 | return sites[(row-1)*N+col]; 67 | } 68 | //判断首尾是否已经连通 69 | public boolean Percolates(){ 70 | if (choice==1) return QF.Find(0)==QF.Find(N*N+1); 71 | return WQU.Find(0)==WQU.Find(N*N+1); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /Algorithm_Experiment/First_Experiment/PercolationStats.java: -------------------------------------------------------------------------------- 1 | package First_Experiment; 2 | 3 | import edu.princeton.cs.algs4.StdRandom; 4 | import edu.princeton.cs.algs4.StdStats; 5 | 6 | public class PercolationStats { 7 | private int sidelength; 8 | private double mean,stddev,confidenceLo,confidenceHi; 9 | private double[] experiments; 10 | 11 | public PercolationStats(int n, int T_Iteration,int choice) { 12 | if(n <= 0 || T_Iteration <= 0) 13 | throw new IllegalArgumentException("Illegal Argument Exception"); 14 | sidelength = n; 15 | if(sidelength == 1){ 16 | mean = 1; //渗透阈值的平均值 17 | stddev = Double.NaN; //渗透阈值的样本标准差 18 | confidenceLo = Double.NaN; //95%置信区间下限 19 | confidenceHi = Double.NaN; //95%置信区间上限 20 | } 21 | else{ 22 | experiments = new double[T_Iteration]; //记录每一次迭代的渗透阈值 23 | for(int i=0; i mid) a[k] = aux[j++]; 23 | else if(j > hi) a[k] = aux[i++]; 24 | else if(less(aux[j],aux[i])) a[k] = aux[j++]; 25 | else a[k] = aux[i++]; 26 | } 27 | } 28 | private boolean less(int a,int b) { 29 | if(a < b) return true; 30 | else return false; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Algorithm_Experiment/Second_Experiment/CompareMain.java: -------------------------------------------------------------------------------- 1 | package Second_Experiment; 2 | 3 | import edu.princeton.cs.algs4.StdStats; 4 | import java.util.Random; 5 | import java.util.Scanner; 6 | 7 | public class CompareMain { 8 | private static double[][] experiments=new double[5][10]; 9 | private static int[] RandomIndex; 10 | 11 | public CompareMain(int[] Randomindex){ 12 | int index[]=new int[Randomindex.length]; 13 | for (int i=0;i<12;i++){ //运行十次,i<10 14 | 15 | //传入5个算法中的参数为index数组,原始数组存放在Randomindex中,所以每次计算之间需要重新将原始数组赋给index 16 | System.arraycopy(Randomindex,0,index,0,Randomindex.length); 17 | long start_time=System.nanoTime(); 18 | Insertion_Sort insertion_sort=new Insertion_Sort(index); 19 | long consumingtime=System.nanoTime()-start_time; //计算总耗费时间,nanoTime单位为纳秒 20 | if(i>=2) experiments[0][i-2]=consumingtime*1.0/1000000; //experiments数组记录5个算法各10次运行的时间 21 | 22 | System.arraycopy(Randomindex,0,index,0,Randomindex.length); 23 | start_time=System.nanoTime(); 24 | Topdown_MergeSort topdown_mergeSort=new Topdown_MergeSort(index); 25 | consumingtime=System.nanoTime()-start_time; //计算总耗费时间 26 | if(i>=2) experiments[1][i-2]=consumingtime*1.0/1000000; 27 | 28 | System.arraycopy(Randomindex,0,index,0,Randomindex.length); 29 | start_time=System.nanoTime(); 30 | Bottomup_MergeSort bottomup_mergeSort=new Bottomup_MergeSort(index); 31 | consumingtime=System.nanoTime()-start_time; //计算总耗费时间 32 | if(i>=2) experiments[2][i-2]=consumingtime*1.0/1000000; 33 | 34 | System.arraycopy(Randomindex,0,index,0,Randomindex.length); 35 | start_time=System.nanoTime(); 36 | Random_QuickSort random_quickSort=new Random_QuickSort(index); 37 | consumingtime=System.nanoTime()-start_time; //计算总耗费时间 38 | if(i>=2) experiments[3][i-2]=consumingtime*1.0/1000000; 39 | 40 | System.arraycopy(Randomindex,0,index,0,Randomindex.length); 41 | start_time=System.nanoTime(); 42 | QuickSort_With_D3P quickSort_with_d3P=new QuickSort_With_D3P(index); 43 | consumingtime=System.nanoTime()-start_time; //计算总耗费时间 44 | if(i>=2) experiments[4][i-2]=consumingtime*1.0/1000000; 45 | } 46 | } 47 | public static void main(String[] args){ 48 | Random rd=new Random(); //随机 49 | Scanner in=new Scanner(System.in); 50 | System.out.print("Please enter the amount of data you want to enter: "); 51 | int count=in.nextInt(); //输入数据规模 52 | RandomIndex=new int[count]; //生成count数量的随机数,存放在数组RandomIndex中 53 | /*for (int i=0;i0 &&less(a[j],a[j-1]) ; j--) { 8 | exch(a, j, j-1); 9 | } 10 | } 11 | } 12 | private boolean less(int a,int b) { 13 | if(a < b) return true; 14 | else return false; 15 | } 16 | private void exch(int[] a,int i,int j) { 17 | int t = a[i]; 18 | a[i] = a[j]; 19 | a[j] = t; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Algorithm_Experiment/Second_Experiment/QuickSort_With_D3P.java: -------------------------------------------------------------------------------- 1 | package Second_Experiment; 2 | 3 | public class QuickSort_With_D3P { 4 | public QuickSort_With_D3P(int[] a) { 5 | sort(a,0,a.length-1); 6 | } 7 | private void sort(int[] a,int lo,int hi) { 8 | if(hi<=lo) return; 9 | int lt = lo,i = lo +1,gt = hi; 10 | int v = a[lo]; 11 | while(i <= gt) { 12 | int cmp = compare(a[i],v); 13 | if(cmp < 0) exch(a, lt++, i++); 14 | else if(cmp > 0) exch(a, i, gt--); 15 | else i++; 16 | } 17 | sort(a,lo,lt-1); 18 | sort(a,gt+1,hi); 19 | } 20 | private int compare(int i,int j) { 21 | if(i < j) return -1; 22 | else return 1; 23 | } 24 | private void exch(int[] a,int i,int j) { 25 | int t = a[i]; 26 | a[i] = a[j]; 27 | a[j] = t; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Algorithm_Experiment/Second_Experiment/Random_QuickSort.java: -------------------------------------------------------------------------------- 1 | package Second_Experiment; 2 | 3 | public class Random_QuickSort { 4 | public Random_QuickSort(int[] a) { 5 | sort(a,0,a.length-1); 6 | } 7 | private void sort(int[] a,int lo,int hi) { 8 | ///if(hi <= lo) return; 9 | if(lo=j) break; 22 | exch(a,i,j); 23 | } 24 | exch(a, lo, j); 25 | return j; 26 | } 27 | private boolean less(int a,int b) { 28 | if(a < b) return true; 29 | else return false; 30 | } 31 | private void exch(int[] a,int i,int j) { 32 | int t = a[i]; 33 | a[i] = a[j]; 34 | a[j] = t; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Algorithm_Experiment/Second_Experiment/Topdown_MergeSort.java: -------------------------------------------------------------------------------- 1 | package Second_Experiment; 2 | 3 | public class Topdown_MergeSort { 4 | private static int[] aux; 5 | public Topdown_MergeSort(int[] a) { 6 | aux = new int[a.length]; 7 | sort(a,0,a.length-1); 8 | } 9 | private void sort(int[] a, int lo,int hi) { 10 | if(hi <= lo) return; 11 | int mid = lo + (hi - lo)/2; 12 | sort(a,lo,mid); 13 | sort(a,mid+1,hi); 14 | merge(a,lo,mid,hi); 15 | } 16 | private void merge(int[] a, int lo,int mid,int hi) { 17 | int i = lo,j = mid+1; 18 | for(int k = lo; k<=hi;k++) 19 | aux[k] = a[k]; 20 | for(int k = lo;k <=hi;k++) { 21 | if(i > mid) a[k] = aux[j++]; 22 | else if(j > hi) a[k] = aux[i++]; 23 | else if(less(aux[j],aux[i])) a[k] = aux[j++]; 24 | else a[k] = aux[i++]; 25 | } 26 | } 27 | private boolean less(int a,int b) { 28 | if(a < b) return true; 29 | else return false; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Algorithm_Experiment/Three_Experiment/Route.java: -------------------------------------------------------------------------------- 1 | package Three; 2 | 3 | import edu.princeton.cs.algs4.*; 4 | import java.text.DecimalFormat; 5 | import java.util.Scanner; 6 | 7 | class Dijkstra_change { 8 | private double[] distTo; 9 | private Edge[] edgeTo; 10 | private IndexMultiwayMinPQ pq; 11 | public Dijkstra_change(EdgeWeightedGraph G, int s, int d, double[][] Nodes) { 12 | for (Edge e : G.edges()) { 13 | if (e.weight() < 0) 14 | throw new IllegalArgumentException("edge " + e + " has negative weight"); 15 | } 16 | distTo = new double[G.V()]; 17 | edgeTo = new Edge[G.V()]; 18 | for (int v = 0; v < G.V(); v++) 19 | distTo[v] = Double.POSITIVE_INFINITY; 20 | distTo[s] = 0.0; 21 | pq = new IndexMultiwayMinPQ(G.V(),2); 22 | pq.insert(s, distTo[s]); 23 | while (!pq.isEmpty()) { 24 | int v = pq.delMin(); 25 | /*if (v == d) // 优化1,当目标节点已发现,停止运行 26 | return;*/ 27 | for (Edge e : G.adj(v)) //从距离最近节点的邻居节点开始遍历 28 | relax(e, v, Nodes, d); //更新dist数组的值 29 | } 30 | } 31 | 32 | private void relax(Edge e, int v, double[][] Nodes, int d) { 33 | int w = e.other(v); // distTo[W] = distTo[V] - V2D + U->V + W2D;A*算法距离公式; 34 | double newDist = distTo[v] + e.weight() + Route.Distance(w,d) - Route.Distance(v,d); 35 | /*if (distTo[w]- 0.000001 > newDist) { 36 | distTo[w] = newDist; //更新dist数组 37 | edgeTo[w] = e; //记录最短距离选择的边 38 | if (pq.contains(w)) //重新插入到队列之中 39 | pq.decreaseKey(w, distTo[w]); 40 | else 41 | pq.insert(w, distTo[w]); 42 | }*/ 43 | if (distTo[w] > distTo[v] + e.weight()) { 44 | distTo[w] = distTo[v] + e.weight(); 45 | edgeTo[w] = e; 46 | if (pq.contains(w)) pq.decreaseKey(w, distTo[w]); 47 | else pq.insert(w, distTo[w]); 48 | } 49 | } 50 | public boolean hasPathTo(int v) { //判断目标节点是否可达 51 | return distTo[v] < Double.POSITIVE_INFINITY; 52 | } 53 | public Iterable pathTo(int v) { 54 | if (!hasPathTo(v)) return null; 55 | Stack path = new Stack(); 56 | int x = v,j=0; 57 | String result[] = new String[10000]; 58 | for(Edge e = edgeTo[v]; e != null; e = edgeTo[x]) { 59 | path.push(e); 60 | DecimalFormat df = new DecimalFormat("#.00"); 61 | String str = df.format(e.weight()); 62 | result[j++]="<"+e.other(x) + "-" + x +"> --- " + str; 63 | x = e.other(x); 64 | } 65 | for (int i=0;i> { 4 | private int maxN; 5 | private int n; 6 | private int[] pq; 7 | private int[] qp; 8 | private Key[] keys; 9 | 10 | public indexPQ(int maxN) { 11 | this.maxN = maxN; 12 | n = 0; 13 | keys = (Key[]) new Comparable[maxN + 1]; 14 | pq = new int[maxN + 1]; 15 | qp = new int[maxN + 1]; 16 | for (int i = 0; i <= maxN; i++) 17 | qp[i] = -1; 18 | } 19 | 20 | public boolean isEmpty() { 21 | return n == 0; 22 | } 23 | 24 | public boolean contains(int i) { 25 | return qp[i] != -1; 26 | } 27 | 28 | public int size() { 29 | return n; 30 | } 31 | 32 | public void insert(int i, Key key) { 33 | n++; 34 | qp[i] = n; 35 | pq[n] = i; 36 | keys[i] = key; 37 | swim(n); 38 | } 39 | 40 | public int delMin() { 41 | int min = pq[1]; 42 | exch(1, n--); 43 | sink(1); 44 | assert min == pq[n + 1]; 45 | qp[min] = -1; 46 | keys[min] = null; 47 | pq[n + 1] = -1; 48 | return min; 49 | } 50 | 51 | public void decreaseKey(int i, Key key) { 52 | keys[i] = key; 53 | swim(qp[i]); 54 | } 55 | 56 | public void delete(int i) { 57 | int index = qp[i]; 58 | exch(index, n--); 59 | swim(index); 60 | sink(index); 61 | keys[i] = null; 62 | qp[i] = -1; 63 | } 64 | 65 | private boolean greater(int i, int j) { 66 | return keys[pq[i]].compareTo(keys[pq[j]]) > 0; 67 | } 68 | 69 | private void exch(int i, int j) { 70 | int swap = pq[i]; 71 | pq[i] = pq[j]; 72 | pq[j] = swap; 73 | qp[pq[i]] = i; 74 | qp[pq[j]] = j; 75 | } 76 | 77 | private void swim(int k) { 78 | while (k > 1 && greater(k / 2, k)) { 79 | exch(k, k / 2); 80 | k = k / 2; 81 | } 82 | } 83 | 84 | private void sink(int k) { 85 | while (2 * k <= n) { 86 | int j = 2 * k; 87 | if (j < n && greater(j, j + 1)) j++; 88 | if (!greater(k, j)) break; 89 | exch(k, j); 90 | k = j; 91 | } 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /Algorithm_Experiment/实验题目.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Travis1024/Course_Code/1e64ed19cd5a0d3c14891cf8eb8d771e5cd13bf8/Algorithm_Experiment/实验题目.docx -------------------------------------------------------------------------------- /Algorithm_Experiment/算法实验报告.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Travis1024/Course_Code/1e64ed19cd5a0d3c14891cf8eb8d771e5cd13bf8/Algorithm_Experiment/算法实验报告.pdf -------------------------------------------------------------------------------- /Course_Design_Fifth/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Datasource local storage ignored files 5 | /../../../../:\Clion file\Course_Design_Fifth\.idea/dataSources/ 6 | /dataSources.local.xml 7 | # Editor-based HTTP Client requests 8 | /httpRequests/ 9 | -------------------------------------------------------------------------------- /Course_Design_Fifth/.idea/Course_Design_Fifth.iml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Course_Design_Fifth/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Course_Design_Fifth/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Course_Design_Fifth/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.17) 2 | project(Course_Design_Fifth) 3 | 4 | set(CMAKE_CXX_STANDARD 14) 5 | 6 | add_executable(Course_Design_Fifth main.cpp) -------------------------------------------------------------------------------- /Course_Design_Fifth/Readme.md: -------------------------------------------------------------------------------- 1 | - [ ] Course_Design_Fifth 文件为Clion项目文件,该项目文件在Clion2020.3版本下可以正常运行; 2 | 3 | Course_Design_Fifth 项目中的txt等文件存放在cmake-build-debug目录下。 4 | 5 | ------ 6 | 7 | 8 | 9 | - [ ] Fifth.cpp文件为代码源文件,其在x86_64-8.1.0-release-posix-sjlj-rt_v6-rev0版本下的mingw64编译器下可以正常编译运行,但是其在运行时需要正确的环境配置,环境配置不正确可能出现 “无法定位程序输入_gxx_personality_v0”的运行错误,其解决方案如下: 10 | 11 | 1.使用-static 编译[g++ -static file.cpp] 12 | 13 | 2.删除掉其他含有libstdc++-6.dll 的PATH环境变量,只留下mingw的 14 | 15 | 3.将 libstdc++-6.dll 文件与代码放置同一文件编译 16 | 17 | 4.将 libstdc++-6.dll 文件放到System32或SysWOW64文件夹下。 18 | 19 | ------ 20 | 21 | 22 | 23 | - [ ] 如果libstdc++-6.dll 文件放置到相应的位置后出现 “0xc000007b——应用程序无法正常启动”,则表明libstdc++-6.dll 文件的版本错误,需要更换正确的版本。 24 | 25 | ------ 26 | 27 | - [ ] 为使程序能够正确运行,程序提供了两个入口,即命令行或直接运行,可根据实际需要选择: 28 | 29 | ```c++ 30 | /*-------------------Main函数-----------------------*/ 31 | /*int main(int argc,char **argv) { 32 | UpdataMap(); 33 | if(strcmp(argv[1],"-a")==0){ 34 | Manager manager; 35 | if(manager.Login_Judge(argv[2],1)){ 36 | manager.Search_Menu(); 37 | } 38 | } else if (strcmp(argv[1],"-u")==0){ 39 | Reader reader; 40 | if(reader.Login_Judge(argv[2],2)){ 41 | reader.Search_Menu(); 42 | } 43 | } 44 | return 0; 45 | }*/ 46 | int main(){ 47 | UpdataMap(); 48 | string a,b; 49 | cin>>a>>b; 50 | if(a=="-a"){ 51 | Manager manager; 52 | if(manager.Login_Judge(b,1)){ 53 | manager.Search_Menu(); 54 | } 55 | } else if (a=="-u"){ 56 | Reader reader; 57 | if(reader.Login_Judge(b,2)){ 58 | reader.Search_Menu(); 59 | } 60 | } 61 | return 0; 62 | } 63 | ``` 64 | 65 | 66 | 67 | - [ ] **总结:****直接在clion环境下运行该程序是最简单的方法,不需要环境的适配,采用其他IDE可能需要正确的运行环境。** -------------------------------------------------------------------------------- /Course_Design_Fifth/TXT文件/BookList.txt: -------------------------------------------------------------------------------- 1 | 003 aaaaa 2 2 2 | 002 asdasd 15 15 3 | 001 Mathbook 10 4 4 | 004 Book_Book 20 14 5 | -------------------------------------------------------------------------------- /Course_Design_Fifth/TXT文件/Manager.txt: -------------------------------------------------------------------------------- 1 | 000 111 222 2 | 123456 000000 Travis 3 | -------------------------------------------------------------------------------- /Course_Design_Fifth/TXT文件/Reader.txt: -------------------------------------------------------------------------------- 1 | 002 000000 Travis_002 2 | 003 000000 tttttt 3 | 001 000000 TravisTravis 4 | -------------------------------------------------------------------------------- /Course_Design_Fifth/TXT文件/ReaderInfoRecord.txt: -------------------------------------------------------------------------------- 1 | 001 Mathbook 6 2 | -------------------------------------------------------------------------------- /Course_Design_Fifth/cmake-build-debug/BookList.txt: -------------------------------------------------------------------------------- 1 | 003 aaaaa 2 2 2 | 002 asdasd 15 15 3 | 001 Mathbook 10 4 4 | 004 Book_Book 20 14 5 | -------------------------------------------------------------------------------- /Course_Design_Fifth/cmake-build-debug/CMakeFiles/3.17.5/CMakeCCompiler.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_C_COMPILER "G:/MinGw_new/mingw64/bin/gcc.exe") 2 | set(CMAKE_C_COMPILER_ARG1 "") 3 | set(CMAKE_C_COMPILER_ID "GNU") 4 | set(CMAKE_C_COMPILER_VERSION "8.1.0") 5 | set(CMAKE_C_COMPILER_VERSION_INTERNAL "") 6 | set(CMAKE_C_COMPILER_WRAPPER "") 7 | set(CMAKE_C_STANDARD_COMPUTED_DEFAULT "11") 8 | set(CMAKE_C_COMPILE_FEATURES "c_std_90;c_function_prototypes;c_std_99;c_restrict;c_variadic_macros;c_std_11;c_static_assert") 9 | set(CMAKE_C90_COMPILE_FEATURES "c_std_90;c_function_prototypes") 10 | set(CMAKE_C99_COMPILE_FEATURES "c_std_99;c_restrict;c_variadic_macros") 11 | set(CMAKE_C11_COMPILE_FEATURES "c_std_11;c_static_assert") 12 | 13 | set(CMAKE_C_PLATFORM_ID "MinGW") 14 | set(CMAKE_C_SIMULATE_ID "") 15 | set(CMAKE_C_COMPILER_FRONTEND_VARIANT "") 16 | set(CMAKE_C_SIMULATE_VERSION "") 17 | 18 | 19 | 20 | set(CMAKE_AR "G:/MinGw_new/mingw64/bin/ar.exe") 21 | set(CMAKE_C_COMPILER_AR "G:/MinGw_new/mingw64/bin/gcc-ar.exe") 22 | set(CMAKE_RANLIB "G:/MinGw_new/mingw64/bin/ranlib.exe") 23 | set(CMAKE_C_COMPILER_RANLIB "G:/MinGw_new/mingw64/bin/gcc-ranlib.exe") 24 | set(CMAKE_LINKER "G:/MinGw_new/mingw64/bin/ld.exe") 25 | set(CMAKE_MT "") 26 | set(CMAKE_COMPILER_IS_GNUCC 1) 27 | set(CMAKE_C_COMPILER_LOADED 1) 28 | set(CMAKE_C_COMPILER_WORKS TRUE) 29 | set(CMAKE_C_ABI_COMPILED TRUE) 30 | set(CMAKE_COMPILER_IS_MINGW 1) 31 | set(CMAKE_COMPILER_IS_CYGWIN ) 32 | if(CMAKE_COMPILER_IS_CYGWIN) 33 | set(CYGWIN 1) 34 | set(UNIX 1) 35 | endif() 36 | 37 | set(CMAKE_C_COMPILER_ENV_VAR "CC") 38 | 39 | if(CMAKE_COMPILER_IS_MINGW) 40 | set(MINGW 1) 41 | endif() 42 | set(CMAKE_C_COMPILER_ID_RUN 1) 43 | set(CMAKE_C_SOURCE_FILE_EXTENSIONS c;m) 44 | set(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC) 45 | set(CMAKE_C_LINKER_PREFERENCE 10) 46 | 47 | # Save compiler ABI information. 48 | set(CMAKE_C_SIZEOF_DATA_PTR "8") 49 | set(CMAKE_C_COMPILER_ABI "") 50 | set(CMAKE_C_LIBRARY_ARCHITECTURE "") 51 | 52 | if(CMAKE_C_SIZEOF_DATA_PTR) 53 | set(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}") 54 | endif() 55 | 56 | if(CMAKE_C_COMPILER_ABI) 57 | set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}") 58 | endif() 59 | 60 | if(CMAKE_C_LIBRARY_ARCHITECTURE) 61 | set(CMAKE_LIBRARY_ARCHITECTURE "") 62 | endif() 63 | 64 | set(CMAKE_C_CL_SHOWINCLUDES_PREFIX "") 65 | if(CMAKE_C_CL_SHOWINCLUDES_PREFIX) 66 | set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_C_CL_SHOWINCLUDES_PREFIX}") 67 | endif() 68 | 69 | 70 | 71 | 72 | 73 | set(CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES "G:/MinGw_new/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include;G:/MinGw_new/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include-fixed;G:/MinGw_new/mingw64/x86_64-w64-mingw32/include") 74 | set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "mingw32;gcc;moldname;mingwex;pthread;advapi32;shell32;user32;kernel32;iconv;mingw32;gcc;moldname;mingwex") 75 | set(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "G:/MinGw_new/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0;G:/MinGw_new/mingw64/lib/gcc;G:/MinGw_new/mingw64/x86_64-w64-mingw32/lib;G:/MinGw_new/mingw64/lib") 76 | set(CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "") 77 | -------------------------------------------------------------------------------- /Course_Design_Fifth/cmake-build-debug/CMakeFiles/3.17.5/CMakeCXXCompiler.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_CXX_COMPILER "G:/MinGw_new/mingw64/bin/g++.exe") 2 | set(CMAKE_CXX_COMPILER_ARG1 "") 3 | set(CMAKE_CXX_COMPILER_ID "GNU") 4 | set(CMAKE_CXX_COMPILER_VERSION "8.1.0") 5 | set(CMAKE_CXX_COMPILER_VERSION_INTERNAL "") 6 | set(CMAKE_CXX_COMPILER_WRAPPER "") 7 | set(CMAKE_CXX_STANDARD_COMPUTED_DEFAULT "14") 8 | set(CMAKE_CXX_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters;cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates;cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates;cxx_std_17;cxx_std_20") 9 | set(CMAKE_CXX98_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters") 10 | set(CMAKE_CXX11_COMPILE_FEATURES "cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates") 11 | set(CMAKE_CXX14_COMPILE_FEATURES "cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates") 12 | set(CMAKE_CXX17_COMPILE_FEATURES "cxx_std_17") 13 | set(CMAKE_CXX20_COMPILE_FEATURES "cxx_std_20") 14 | 15 | set(CMAKE_CXX_PLATFORM_ID "MinGW") 16 | set(CMAKE_CXX_SIMULATE_ID "") 17 | set(CMAKE_CXX_COMPILER_FRONTEND_VARIANT "") 18 | set(CMAKE_CXX_SIMULATE_VERSION "") 19 | 20 | 21 | 22 | set(CMAKE_AR "G:/MinGw_new/mingw64/bin/ar.exe") 23 | set(CMAKE_CXX_COMPILER_AR "G:/MinGw_new/mingw64/bin/gcc-ar.exe") 24 | set(CMAKE_RANLIB "G:/MinGw_new/mingw64/bin/ranlib.exe") 25 | set(CMAKE_CXX_COMPILER_RANLIB "G:/MinGw_new/mingw64/bin/gcc-ranlib.exe") 26 | set(CMAKE_LINKER "G:/MinGw_new/mingw64/bin/ld.exe") 27 | set(CMAKE_MT "") 28 | set(CMAKE_COMPILER_IS_GNUCXX 1) 29 | set(CMAKE_CXX_COMPILER_LOADED 1) 30 | set(CMAKE_CXX_COMPILER_WORKS TRUE) 31 | set(CMAKE_CXX_ABI_COMPILED TRUE) 32 | set(CMAKE_COMPILER_IS_MINGW 1) 33 | set(CMAKE_COMPILER_IS_CYGWIN ) 34 | if(CMAKE_COMPILER_IS_CYGWIN) 35 | set(CYGWIN 1) 36 | set(UNIX 1) 37 | endif() 38 | 39 | set(CMAKE_CXX_COMPILER_ENV_VAR "CXX") 40 | 41 | if(CMAKE_COMPILER_IS_MINGW) 42 | set(MINGW 1) 43 | endif() 44 | set(CMAKE_CXX_COMPILER_ID_RUN 1) 45 | set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;m;mm;CPP) 46 | set(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC) 47 | 48 | foreach (lang C OBJC OBJCXX) 49 | if (CMAKE_${lang}_COMPILER_ID_RUN) 50 | foreach(extension IN LISTS CMAKE_${lang}_SOURCE_FILE_EXTENSIONS) 51 | list(REMOVE_ITEM CMAKE_CXX_SOURCE_FILE_EXTENSIONS ${extension}) 52 | endforeach() 53 | endif() 54 | endforeach() 55 | 56 | set(CMAKE_CXX_LINKER_PREFERENCE 30) 57 | set(CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES 1) 58 | 59 | # Save compiler ABI information. 60 | set(CMAKE_CXX_SIZEOF_DATA_PTR "8") 61 | set(CMAKE_CXX_COMPILER_ABI "") 62 | set(CMAKE_CXX_LIBRARY_ARCHITECTURE "") 63 | 64 | if(CMAKE_CXX_SIZEOF_DATA_PTR) 65 | set(CMAKE_SIZEOF_VOID_P "${CMAKE_CXX_SIZEOF_DATA_PTR}") 66 | endif() 67 | 68 | if(CMAKE_CXX_COMPILER_ABI) 69 | set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_CXX_COMPILER_ABI}") 70 | endif() 71 | 72 | if(CMAKE_CXX_LIBRARY_ARCHITECTURE) 73 | set(CMAKE_LIBRARY_ARCHITECTURE "") 74 | endif() 75 | 76 | set(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX "") 77 | if(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX) 78 | set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_CXX_CL_SHOWINCLUDES_PREFIX}") 79 | endif() 80 | 81 | 82 | 83 | 84 | 85 | set(CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES "G:/MinGw_new/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++;G:/MinGw_new/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/x86_64-w64-mingw32;G:/MinGw_new/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/backward;G:/MinGw_new/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include;G:/MinGw_new/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include-fixed;G:/MinGw_new/mingw64/x86_64-w64-mingw32/include") 86 | set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "stdc++;mingw32;gcc_s;gcc;moldname;mingwex;pthread;advapi32;shell32;user32;kernel32;iconv;mingw32;gcc_s;gcc;moldname;mingwex") 87 | set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "G:/MinGw_new/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0;G:/MinGw_new/mingw64/lib/gcc;G:/MinGw_new/mingw64/x86_64-w64-mingw32/lib;G:/MinGw_new/mingw64/lib") 88 | set(CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "") 89 | -------------------------------------------------------------------------------- /Course_Design_Fifth/cmake-build-debug/CMakeFiles/3.17.5/CMakeDetermineCompilerABI_C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Travis1024/Course_Code/1e64ed19cd5a0d3c14891cf8eb8d771e5cd13bf8/Course_Design_Fifth/cmake-build-debug/CMakeFiles/3.17.5/CMakeDetermineCompilerABI_C.bin -------------------------------------------------------------------------------- /Course_Design_Fifth/cmake-build-debug/CMakeFiles/3.17.5/CMakeDetermineCompilerABI_CXX.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Travis1024/Course_Code/1e64ed19cd5a0d3c14891cf8eb8d771e5cd13bf8/Course_Design_Fifth/cmake-build-debug/CMakeFiles/3.17.5/CMakeDetermineCompilerABI_CXX.bin -------------------------------------------------------------------------------- /Course_Design_Fifth/cmake-build-debug/CMakeFiles/3.17.5/CMakeRCCompiler.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_RC_COMPILER "G:/MinGw_new/mingw64/bin/windres.exe") 2 | set(CMAKE_RC_COMPILER_ARG1 "") 3 | set(CMAKE_RC_COMPILER_LOADED 1) 4 | set(CMAKE_RC_SOURCE_FILE_EXTENSIONS rc;RC) 5 | set(CMAKE_RC_OUTPUT_EXTENSION .obj) 6 | set(CMAKE_RC_COMPILER_ENV_VAR "RC") 7 | -------------------------------------------------------------------------------- /Course_Design_Fifth/cmake-build-debug/CMakeFiles/3.17.5/CMakeSystem.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_HOST_SYSTEM "Windows-10.0.18363") 2 | set(CMAKE_HOST_SYSTEM_NAME "Windows") 3 | set(CMAKE_HOST_SYSTEM_VERSION "10.0.18363") 4 | set(CMAKE_HOST_SYSTEM_PROCESSOR "AMD64") 5 | 6 | 7 | 8 | set(CMAKE_SYSTEM "Windows-10.0.18363") 9 | set(CMAKE_SYSTEM_NAME "Windows") 10 | set(CMAKE_SYSTEM_VERSION "10.0.18363") 11 | set(CMAKE_SYSTEM_PROCESSOR "AMD64") 12 | 13 | set(CMAKE_CROSSCOMPILING "FALSE") 14 | 15 | set(CMAKE_SYSTEM_LOADED 1) 16 | -------------------------------------------------------------------------------- /Course_Design_Fifth/cmake-build-debug/CMakeFiles/3.17.5/CompilerIdC/CMakeCCompilerId.c: -------------------------------------------------------------------------------- 1 | #ifdef __cplusplus 2 | # error "A C++ compiler has been selected for C." 3 | #endif 4 | 5 | #if defined(__18CXX) 6 | # define ID_VOID_MAIN 7 | #endif 8 | #if defined(__CLASSIC_C__) 9 | /* cv-qualifiers did not exist in K&R C */ 10 | # define const 11 | # define volatile 12 | #endif 13 | 14 | 15 | /* Version number components: V=Version, R=Revision, P=Patch 16 | Version date components: YYYY=Year, MM=Month, DD=Day */ 17 | 18 | #if defined(__INTEL_COMPILER) || defined(__ICC) 19 | # define COMPILER_ID "Intel" 20 | # if defined(_MSC_VER) 21 | # define SIMULATE_ID "MSVC" 22 | # endif 23 | # if defined(__GNUC__) 24 | # define SIMULATE_ID "GNU" 25 | # endif 26 | /* __INTEL_COMPILER = VRP */ 27 | # define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100) 28 | # define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10) 29 | # if defined(__INTEL_COMPILER_UPDATE) 30 | # define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE) 31 | # else 32 | # define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10) 33 | # endif 34 | # if defined(__INTEL_COMPILER_BUILD_DATE) 35 | /* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */ 36 | # define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE) 37 | # endif 38 | # if defined(_MSC_VER) 39 | /* _MSC_VER = VVRR */ 40 | # define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) 41 | # define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) 42 | # endif 43 | # if defined(__GNUC__) 44 | # define SIMULATE_VERSION_MAJOR DEC(__GNUC__) 45 | # elif defined(__GNUG__) 46 | # define SIMULATE_VERSION_MAJOR DEC(__GNUG__) 47 | # endif 48 | # if defined(__GNUC_MINOR__) 49 | # define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__) 50 | # endif 51 | # if defined(__GNUC_PATCHLEVEL__) 52 | # define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) 53 | # endif 54 | 55 | #elif defined(__PATHCC__) 56 | # define COMPILER_ID "PathScale" 57 | # define COMPILER_VERSION_MAJOR DEC(__PATHCC__) 58 | # define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__) 59 | # if defined(__PATHCC_PATCHLEVEL__) 60 | # define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__) 61 | # endif 62 | 63 | #elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__) 64 | # define COMPILER_ID "Embarcadero" 65 | # define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF) 66 | # define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF) 67 | # define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF) 68 | 69 | #elif defined(__BORLANDC__) 70 | # define COMPILER_ID "Borland" 71 | /* __BORLANDC__ = 0xVRR */ 72 | # define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8) 73 | # define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF) 74 | 75 | #elif defined(__WATCOMC__) && __WATCOMC__ < 1200 76 | # define COMPILER_ID "Watcom" 77 | /* __WATCOMC__ = VVRR */ 78 | # define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100) 79 | # define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) 80 | # if (__WATCOMC__ % 10) > 0 81 | # define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) 82 | # endif 83 | 84 | #elif defined(__WATCOMC__) 85 | # define COMPILER_ID "OpenWatcom" 86 | /* __WATCOMC__ = VVRP + 1100 */ 87 | # define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100) 88 | # define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) 89 | # if (__WATCOMC__ % 10) > 0 90 | # define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) 91 | # endif 92 | 93 | #elif defined(__SUNPRO_C) 94 | # define COMPILER_ID "SunPro" 95 | # if __SUNPRO_C >= 0x5100 96 | /* __SUNPRO_C = 0xVRRP */ 97 | # define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>12) 98 | # define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xFF) 99 | # define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF) 100 | # else 101 | /* __SUNPRO_CC = 0xVRP */ 102 | # define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>8) 103 | # define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xF) 104 | # define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF) 105 | # endif 106 | 107 | #elif defined(__HP_cc) 108 | # define COMPILER_ID "HP" 109 | /* __HP_cc = VVRRPP */ 110 | # define COMPILER_VERSION_MAJOR DEC(__HP_cc/10000) 111 | # define COMPILER_VERSION_MINOR DEC(__HP_cc/100 % 100) 112 | # define COMPILER_VERSION_PATCH DEC(__HP_cc % 100) 113 | 114 | #elif defined(__DECC) 115 | # define COMPILER_ID "Compaq" 116 | /* __DECC_VER = VVRRTPPPP */ 117 | # define COMPILER_VERSION_MAJOR DEC(__DECC_VER/10000000) 118 | # define COMPILER_VERSION_MINOR DEC(__DECC_VER/100000 % 100) 119 | # define COMPILER_VERSION_PATCH DEC(__DECC_VER % 10000) 120 | 121 | #elif defined(__IBMC__) && defined(__COMPILER_VER__) 122 | # define COMPILER_ID "zOS" 123 | /* __IBMC__ = VRP */ 124 | # define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) 125 | # define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) 126 | # define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) 127 | 128 | #elif defined(__ibmxl__) && defined(__clang__) 129 | # define COMPILER_ID "XLClang" 130 | # define COMPILER_VERSION_MAJOR DEC(__ibmxl_version__) 131 | # define COMPILER_VERSION_MINOR DEC(__ibmxl_release__) 132 | # define COMPILER_VERSION_PATCH DEC(__ibmxl_modification__) 133 | # define COMPILER_VERSION_TWEAK DEC(__ibmxl_ptf_fix_level__) 134 | 135 | 136 | #elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ >= 800 137 | # define COMPILER_ID "XL" 138 | /* __IBMC__ = VRP */ 139 | # define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) 140 | # define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) 141 | # define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) 142 | 143 | #elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ < 800 144 | # define COMPILER_ID "VisualAge" 145 | /* __IBMC__ = VRP */ 146 | # define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) 147 | # define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) 148 | # define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) 149 | 150 | #elif defined(__PGI) 151 | # define COMPILER_ID "PGI" 152 | # define COMPILER_VERSION_MAJOR DEC(__PGIC__) 153 | # define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__) 154 | # if defined(__PGIC_PATCHLEVEL__) 155 | # define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__) 156 | # endif 157 | 158 | #elif defined(_CRAYC) 159 | # define COMPILER_ID "Cray" 160 | # define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR) 161 | # define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR) 162 | 163 | #elif defined(__TI_COMPILER_VERSION__) 164 | # define COMPILER_ID "TI" 165 | /* __TI_COMPILER_VERSION__ = VVVRRRPPP */ 166 | # define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000) 167 | # define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000) 168 | # define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000) 169 | 170 | #elif defined(__FUJITSU) || defined(__FCC_VERSION) || defined(__fcc_version) 171 | # define COMPILER_ID "Fujitsu" 172 | 173 | #elif defined(__ghs__) 174 | # define COMPILER_ID "GHS" 175 | /* __GHS_VERSION_NUMBER = VVVVRP */ 176 | # ifdef __GHS_VERSION_NUMBER 177 | # define COMPILER_VERSION_MAJOR DEC(__GHS_VERSION_NUMBER / 100) 178 | # define COMPILER_VERSION_MINOR DEC(__GHS_VERSION_NUMBER / 10 % 10) 179 | # define COMPILER_VERSION_PATCH DEC(__GHS_VERSION_NUMBER % 10) 180 | # endif 181 | 182 | #elif defined(__TINYC__) 183 | # define COMPILER_ID "TinyCC" 184 | 185 | #elif defined(__BCC__) 186 | # define COMPILER_ID "Bruce" 187 | 188 | #elif defined(__SCO_VERSION__) 189 | # define COMPILER_ID "SCO" 190 | 191 | #elif defined(__ARMCC_VERSION) && !defined(__clang__) 192 | # define COMPILER_ID "ARMCC" 193 | #if __ARMCC_VERSION >= 1000000 194 | /* __ARMCC_VERSION = VRRPPPP */ 195 | # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000) 196 | # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100) 197 | # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) 198 | #else 199 | /* __ARMCC_VERSION = VRPPPP */ 200 | # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000) 201 | # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10) 202 | # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) 203 | #endif 204 | 205 | 206 | #elif defined(__clang__) && defined(__apple_build_version__) 207 | # define COMPILER_ID "AppleClang" 208 | # if defined(_MSC_VER) 209 | # define SIMULATE_ID "MSVC" 210 | # endif 211 | # define COMPILER_VERSION_MAJOR DEC(__clang_major__) 212 | # define COMPILER_VERSION_MINOR DEC(__clang_minor__) 213 | # define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) 214 | # if defined(_MSC_VER) 215 | /* _MSC_VER = VVRR */ 216 | # define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) 217 | # define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) 218 | # endif 219 | # define COMPILER_VERSION_TWEAK DEC(__apple_build_version__) 220 | 221 | #elif defined(__clang__) && defined(__ARMCOMPILER_VERSION) 222 | # define COMPILER_ID "ARMClang" 223 | # define COMPILER_VERSION_MAJOR DEC(__ARMCOMPILER_VERSION/1000000) 224 | # define COMPILER_VERSION_MINOR DEC(__ARMCOMPILER_VERSION/10000 % 100) 225 | # define COMPILER_VERSION_PATCH DEC(__ARMCOMPILER_VERSION % 10000) 226 | # define COMPILER_VERSION_INTERNAL DEC(__ARMCOMPILER_VERSION) 227 | 228 | #elif defined(__clang__) 229 | # define COMPILER_ID "Clang" 230 | # if defined(_MSC_VER) 231 | # define SIMULATE_ID "MSVC" 232 | # endif 233 | # define COMPILER_VERSION_MAJOR DEC(__clang_major__) 234 | # define COMPILER_VERSION_MINOR DEC(__clang_minor__) 235 | # define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) 236 | # if defined(_MSC_VER) 237 | /* _MSC_VER = VVRR */ 238 | # define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) 239 | # define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) 240 | # endif 241 | 242 | #elif defined(__GNUC__) 243 | # define COMPILER_ID "GNU" 244 | # define COMPILER_VERSION_MAJOR DEC(__GNUC__) 245 | # if defined(__GNUC_MINOR__) 246 | # define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__) 247 | # endif 248 | # if defined(__GNUC_PATCHLEVEL__) 249 | # define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) 250 | # endif 251 | 252 | #elif defined(_MSC_VER) 253 | # define COMPILER_ID "MSVC" 254 | /* _MSC_VER = VVRR */ 255 | # define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100) 256 | # define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100) 257 | # if defined(_MSC_FULL_VER) 258 | # if _MSC_VER >= 1400 259 | /* _MSC_FULL_VER = VVRRPPPPP */ 260 | # define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000) 261 | # else 262 | /* _MSC_FULL_VER = VVRRPPPP */ 263 | # define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000) 264 | # endif 265 | # endif 266 | # if defined(_MSC_BUILD) 267 | # define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD) 268 | # endif 269 | 270 | #elif defined(__VISUALDSPVERSION__) || defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__) 271 | # define COMPILER_ID "ADSP" 272 | #if defined(__VISUALDSPVERSION__) 273 | /* __VISUALDSPVERSION__ = 0xVVRRPP00 */ 274 | # define COMPILER_VERSION_MAJOR HEX(__VISUALDSPVERSION__>>24) 275 | # define COMPILER_VERSION_MINOR HEX(__VISUALDSPVERSION__>>16 & 0xFF) 276 | # define COMPILER_VERSION_PATCH HEX(__VISUALDSPVERSION__>>8 & 0xFF) 277 | #endif 278 | 279 | #elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) 280 | # define COMPILER_ID "IAR" 281 | # if defined(__VER__) && defined(__ICCARM__) 282 | # define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000) 283 | # define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000) 284 | # define COMPILER_VERSION_PATCH DEC((__VER__) % 1000) 285 | # define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) 286 | # elif defined(__VER__) && (defined(__ICCAVR__) || defined(__ICCRX__) || defined(__ICCRH850__) || defined(__ICCRL78__) || defined(__ICC430__) || defined(__ICCRISCV__) || defined(__ICCV850__) || defined(__ICC8051__)) 287 | # define COMPILER_VERSION_MAJOR DEC((__VER__) / 100) 288 | # define COMPILER_VERSION_MINOR DEC((__VER__) - (((__VER__) / 100)*100)) 289 | # define COMPILER_VERSION_PATCH DEC(__SUBVERSION__) 290 | # define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) 291 | # endif 292 | 293 | #elif defined(__SDCC_VERSION_MAJOR) || defined(SDCC) 294 | # define COMPILER_ID "SDCC" 295 | # if defined(__SDCC_VERSION_MAJOR) 296 | # define COMPILER_VERSION_MAJOR DEC(__SDCC_VERSION_MAJOR) 297 | # define COMPILER_VERSION_MINOR DEC(__SDCC_VERSION_MINOR) 298 | # define COMPILER_VERSION_PATCH DEC(__SDCC_VERSION_PATCH) 299 | # else 300 | /* SDCC = VRP */ 301 | # define COMPILER_VERSION_MAJOR DEC(SDCC/100) 302 | # define COMPILER_VERSION_MINOR DEC(SDCC/10 % 10) 303 | # define COMPILER_VERSION_PATCH DEC(SDCC % 10) 304 | # endif 305 | 306 | 307 | /* These compilers are either not known or too old to define an 308 | identification macro. Try to identify the platform and guess that 309 | it is the native compiler. */ 310 | #elif defined(__hpux) || defined(__hpua) 311 | # define COMPILER_ID "HP" 312 | 313 | #else /* unknown compiler */ 314 | # define COMPILER_ID "" 315 | #endif 316 | 317 | /* Construct the string literal in pieces to prevent the source from 318 | getting matched. Store it in a pointer rather than an array 319 | because some compilers will just produce instructions to fill the 320 | array rather than assigning a pointer to a static array. */ 321 | char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]"; 322 | #ifdef SIMULATE_ID 323 | char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]"; 324 | #endif 325 | 326 | #ifdef __QNXNTO__ 327 | char const* qnxnto = "INFO" ":" "qnxnto[]"; 328 | #endif 329 | 330 | #if defined(__CRAYXE) || defined(__CRAYXC) 331 | char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]"; 332 | #endif 333 | 334 | #define STRINGIFY_HELPER(X) #X 335 | #define STRINGIFY(X) STRINGIFY_HELPER(X) 336 | 337 | /* Identify known platforms by name. */ 338 | #if defined(__linux) || defined(__linux__) || defined(linux) 339 | # define PLATFORM_ID "Linux" 340 | 341 | #elif defined(__CYGWIN__) 342 | # define PLATFORM_ID "Cygwin" 343 | 344 | #elif defined(__MINGW32__) 345 | # define PLATFORM_ID "MinGW" 346 | 347 | #elif defined(__APPLE__) 348 | # define PLATFORM_ID "Darwin" 349 | 350 | #elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) 351 | # define PLATFORM_ID "Windows" 352 | 353 | #elif defined(__FreeBSD__) || defined(__FreeBSD) 354 | # define PLATFORM_ID "FreeBSD" 355 | 356 | #elif defined(__NetBSD__) || defined(__NetBSD) 357 | # define PLATFORM_ID "NetBSD" 358 | 359 | #elif defined(__OpenBSD__) || defined(__OPENBSD) 360 | # define PLATFORM_ID "OpenBSD" 361 | 362 | #elif defined(__sun) || defined(sun) 363 | # define PLATFORM_ID "SunOS" 364 | 365 | #elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__) 366 | # define PLATFORM_ID "AIX" 367 | 368 | #elif defined(__hpux) || defined(__hpux__) 369 | # define PLATFORM_ID "HP-UX" 370 | 371 | #elif defined(__HAIKU__) 372 | # define PLATFORM_ID "Haiku" 373 | 374 | #elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS) 375 | # define PLATFORM_ID "BeOS" 376 | 377 | #elif defined(__QNX__) || defined(__QNXNTO__) 378 | # define PLATFORM_ID "QNX" 379 | 380 | #elif defined(__tru64) || defined(_tru64) || defined(__TRU64__) 381 | # define PLATFORM_ID "Tru64" 382 | 383 | #elif defined(__riscos) || defined(__riscos__) 384 | # define PLATFORM_ID "RISCos" 385 | 386 | #elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__) 387 | # define PLATFORM_ID "SINIX" 388 | 389 | #elif defined(__UNIX_SV__) 390 | # define PLATFORM_ID "UNIX_SV" 391 | 392 | #elif defined(__bsdos__) 393 | # define PLATFORM_ID "BSDOS" 394 | 395 | #elif defined(_MPRAS) || defined(MPRAS) 396 | # define PLATFORM_ID "MP-RAS" 397 | 398 | #elif defined(__osf) || defined(__osf__) 399 | # define PLATFORM_ID "OSF1" 400 | 401 | #elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv) 402 | # define PLATFORM_ID "SCO_SV" 403 | 404 | #elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX) 405 | # define PLATFORM_ID "ULTRIX" 406 | 407 | #elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX) 408 | # define PLATFORM_ID "Xenix" 409 | 410 | #elif defined(__WATCOMC__) 411 | # if defined(__LINUX__) 412 | # define PLATFORM_ID "Linux" 413 | 414 | # elif defined(__DOS__) 415 | # define PLATFORM_ID "DOS" 416 | 417 | # elif defined(__OS2__) 418 | # define PLATFORM_ID "OS2" 419 | 420 | # elif defined(__WINDOWS__) 421 | # define PLATFORM_ID "Windows3x" 422 | 423 | # else /* unknown platform */ 424 | # define PLATFORM_ID 425 | # endif 426 | 427 | #elif defined(__INTEGRITY) 428 | # if defined(INT_178B) 429 | # define PLATFORM_ID "Integrity178" 430 | 431 | # else /* regular Integrity */ 432 | # define PLATFORM_ID "Integrity" 433 | # endif 434 | 435 | #else /* unknown platform */ 436 | # define PLATFORM_ID 437 | 438 | #endif 439 | 440 | /* For windows compilers MSVC and Intel we can determine 441 | the architecture of the compiler being used. This is because 442 | the compilers do not have flags that can change the architecture, 443 | but rather depend on which compiler is being used 444 | */ 445 | #if defined(_WIN32) && defined(_MSC_VER) 446 | # if defined(_M_IA64) 447 | # define ARCHITECTURE_ID "IA64" 448 | 449 | # elif defined(_M_X64) || defined(_M_AMD64) 450 | # define ARCHITECTURE_ID "x64" 451 | 452 | # elif defined(_M_IX86) 453 | # define ARCHITECTURE_ID "X86" 454 | 455 | # elif defined(_M_ARM64) 456 | # define ARCHITECTURE_ID "ARM64" 457 | 458 | # elif defined(_M_ARM) 459 | # if _M_ARM == 4 460 | # define ARCHITECTURE_ID "ARMV4I" 461 | # elif _M_ARM == 5 462 | # define ARCHITECTURE_ID "ARMV5I" 463 | # else 464 | # define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM) 465 | # endif 466 | 467 | # elif defined(_M_MIPS) 468 | # define ARCHITECTURE_ID "MIPS" 469 | 470 | # elif defined(_M_SH) 471 | # define ARCHITECTURE_ID "SHx" 472 | 473 | # else /* unknown architecture */ 474 | # define ARCHITECTURE_ID "" 475 | # endif 476 | 477 | #elif defined(__WATCOMC__) 478 | # if defined(_M_I86) 479 | # define ARCHITECTURE_ID "I86" 480 | 481 | # elif defined(_M_IX86) 482 | # define ARCHITECTURE_ID "X86" 483 | 484 | # else /* unknown architecture */ 485 | # define ARCHITECTURE_ID "" 486 | # endif 487 | 488 | #elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) 489 | # if defined(__ICCARM__) 490 | # define ARCHITECTURE_ID "ARM" 491 | 492 | # elif defined(__ICCRX__) 493 | # define ARCHITECTURE_ID "RX" 494 | 495 | # elif defined(__ICCRH850__) 496 | # define ARCHITECTURE_ID "RH850" 497 | 498 | # elif defined(__ICCRL78__) 499 | # define ARCHITECTURE_ID "RL78" 500 | 501 | # elif defined(__ICCRISCV__) 502 | # define ARCHITECTURE_ID "RISCV" 503 | 504 | # elif defined(__ICCAVR__) 505 | # define ARCHITECTURE_ID "AVR" 506 | 507 | # elif defined(__ICC430__) 508 | # define ARCHITECTURE_ID "MSP430" 509 | 510 | # elif defined(__ICCV850__) 511 | # define ARCHITECTURE_ID "V850" 512 | 513 | # elif defined(__ICC8051__) 514 | # define ARCHITECTURE_ID "8051" 515 | 516 | # else /* unknown architecture */ 517 | # define ARCHITECTURE_ID "" 518 | # endif 519 | 520 | #elif defined(__ghs__) 521 | # if defined(__PPC64__) 522 | # define ARCHITECTURE_ID "PPC64" 523 | 524 | # elif defined(__ppc__) 525 | # define ARCHITECTURE_ID "PPC" 526 | 527 | # elif defined(__ARM__) 528 | # define ARCHITECTURE_ID "ARM" 529 | 530 | # elif defined(__x86_64__) 531 | # define ARCHITECTURE_ID "x64" 532 | 533 | # elif defined(__i386__) 534 | # define ARCHITECTURE_ID "X86" 535 | 536 | # else /* unknown architecture */ 537 | # define ARCHITECTURE_ID "" 538 | # endif 539 | #else 540 | # define ARCHITECTURE_ID 541 | #endif 542 | 543 | /* Convert integer to decimal digit literals. */ 544 | #define DEC(n) \ 545 | ('0' + (((n) / 10000000)%10)), \ 546 | ('0' + (((n) / 1000000)%10)), \ 547 | ('0' + (((n) / 100000)%10)), \ 548 | ('0' + (((n) / 10000)%10)), \ 549 | ('0' + (((n) / 1000)%10)), \ 550 | ('0' + (((n) / 100)%10)), \ 551 | ('0' + (((n) / 10)%10)), \ 552 | ('0' + ((n) % 10)) 553 | 554 | /* Convert integer to hex digit literals. */ 555 | #define HEX(n) \ 556 | ('0' + ((n)>>28 & 0xF)), \ 557 | ('0' + ((n)>>24 & 0xF)), \ 558 | ('0' + ((n)>>20 & 0xF)), \ 559 | ('0' + ((n)>>16 & 0xF)), \ 560 | ('0' + ((n)>>12 & 0xF)), \ 561 | ('0' + ((n)>>8 & 0xF)), \ 562 | ('0' + ((n)>>4 & 0xF)), \ 563 | ('0' + ((n) & 0xF)) 564 | 565 | /* Construct a string literal encoding the version number components. */ 566 | #ifdef COMPILER_VERSION_MAJOR 567 | char const info_version[] = { 568 | 'I', 'N', 'F', 'O', ':', 569 | 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[', 570 | COMPILER_VERSION_MAJOR, 571 | # ifdef COMPILER_VERSION_MINOR 572 | '.', COMPILER_VERSION_MINOR, 573 | # ifdef COMPILER_VERSION_PATCH 574 | '.', COMPILER_VERSION_PATCH, 575 | # ifdef COMPILER_VERSION_TWEAK 576 | '.', COMPILER_VERSION_TWEAK, 577 | # endif 578 | # endif 579 | # endif 580 | ']','\0'}; 581 | #endif 582 | 583 | /* Construct a string literal encoding the internal version number. */ 584 | #ifdef COMPILER_VERSION_INTERNAL 585 | char const info_version_internal[] = { 586 | 'I', 'N', 'F', 'O', ':', 587 | 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_', 588 | 'i','n','t','e','r','n','a','l','[', 589 | COMPILER_VERSION_INTERNAL,']','\0'}; 590 | #endif 591 | 592 | /* Construct a string literal encoding the version number components. */ 593 | #ifdef SIMULATE_VERSION_MAJOR 594 | char const info_simulate_version[] = { 595 | 'I', 'N', 'F', 'O', ':', 596 | 's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[', 597 | SIMULATE_VERSION_MAJOR, 598 | # ifdef SIMULATE_VERSION_MINOR 599 | '.', SIMULATE_VERSION_MINOR, 600 | # ifdef SIMULATE_VERSION_PATCH 601 | '.', SIMULATE_VERSION_PATCH, 602 | # ifdef SIMULATE_VERSION_TWEAK 603 | '.', SIMULATE_VERSION_TWEAK, 604 | # endif 605 | # endif 606 | # endif 607 | ']','\0'}; 608 | #endif 609 | 610 | /* Construct the string literal in pieces to prevent the source from 611 | getting matched. Store it in a pointer rather than an array 612 | because some compilers will just produce instructions to fill the 613 | array rather than assigning a pointer to a static array. */ 614 | char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]"; 615 | char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]"; 616 | 617 | 618 | 619 | 620 | #if !defined(__STDC__) 621 | # if (defined(_MSC_VER) && !defined(__clang__)) \ 622 | || (defined(__ibmxl__) || defined(__IBMC__)) 623 | # define C_DIALECT "90" 624 | # else 625 | # define C_DIALECT 626 | # endif 627 | #elif __STDC_VERSION__ >= 201000L 628 | # define C_DIALECT "11" 629 | #elif __STDC_VERSION__ >= 199901L 630 | # define C_DIALECT "99" 631 | #else 632 | # define C_DIALECT "90" 633 | #endif 634 | const char* info_language_dialect_default = 635 | "INFO" ":" "dialect_default[" C_DIALECT "]"; 636 | 637 | /*--------------------------------------------------------------------------*/ 638 | 639 | #ifdef ID_VOID_MAIN 640 | void main() {} 641 | #else 642 | # if defined(__CLASSIC_C__) 643 | int main(argc, argv) int argc; char *argv[]; 644 | # else 645 | int main(int argc, char* argv[]) 646 | # endif 647 | { 648 | int require = 0; 649 | require += info_compiler[argc]; 650 | require += info_platform[argc]; 651 | require += info_arch[argc]; 652 | #ifdef COMPILER_VERSION_MAJOR 653 | require += info_version[argc]; 654 | #endif 655 | #ifdef COMPILER_VERSION_INTERNAL 656 | require += info_version_internal[argc]; 657 | #endif 658 | #ifdef SIMULATE_ID 659 | require += info_simulate[argc]; 660 | #endif 661 | #ifdef SIMULATE_VERSION_MAJOR 662 | require += info_simulate_version[argc]; 663 | #endif 664 | #if defined(__CRAYXE) || defined(__CRAYXC) 665 | require += info_cray[argc]; 666 | #endif 667 | require += info_language_dialect_default[argc]; 668 | (void)argv; 669 | return require; 670 | } 671 | #endif 672 | -------------------------------------------------------------------------------- /Course_Design_Fifth/cmake-build-debug/CMakeFiles/3.17.5/CompilerIdC/a.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Travis1024/Course_Code/1e64ed19cd5a0d3c14891cf8eb8d771e5cd13bf8/Course_Design_Fifth/cmake-build-debug/CMakeFiles/3.17.5/CompilerIdC/a.exe -------------------------------------------------------------------------------- /Course_Design_Fifth/cmake-build-debug/CMakeFiles/3.17.5/CompilerIdCXX/CMakeCXXCompilerId.cpp: -------------------------------------------------------------------------------- 1 | /* This source file must have a .cpp extension so that all C++ compilers 2 | recognize the extension without flags. Borland does not know .cxx for 3 | example. */ 4 | #ifndef __cplusplus 5 | # error "A C compiler has been selected for C++." 6 | #endif 7 | 8 | 9 | /* Version number components: V=Version, R=Revision, P=Patch 10 | Version date components: YYYY=Year, MM=Month, DD=Day */ 11 | 12 | #if defined(__COMO__) 13 | # define COMPILER_ID "Comeau" 14 | /* __COMO_VERSION__ = VRR */ 15 | # define COMPILER_VERSION_MAJOR DEC(__COMO_VERSION__ / 100) 16 | # define COMPILER_VERSION_MINOR DEC(__COMO_VERSION__ % 100) 17 | 18 | #elif defined(__INTEL_COMPILER) || defined(__ICC) 19 | # define COMPILER_ID "Intel" 20 | # if defined(_MSC_VER) 21 | # define SIMULATE_ID "MSVC" 22 | # endif 23 | # if defined(__GNUC__) 24 | # define SIMULATE_ID "GNU" 25 | # endif 26 | /* __INTEL_COMPILER = VRP */ 27 | # define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100) 28 | # define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10) 29 | # if defined(__INTEL_COMPILER_UPDATE) 30 | # define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE) 31 | # else 32 | # define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10) 33 | # endif 34 | # if defined(__INTEL_COMPILER_BUILD_DATE) 35 | /* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */ 36 | # define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE) 37 | # endif 38 | # if defined(_MSC_VER) 39 | /* _MSC_VER = VVRR */ 40 | # define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) 41 | # define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) 42 | # endif 43 | # if defined(__GNUC__) 44 | # define SIMULATE_VERSION_MAJOR DEC(__GNUC__) 45 | # elif defined(__GNUG__) 46 | # define SIMULATE_VERSION_MAJOR DEC(__GNUG__) 47 | # endif 48 | # if defined(__GNUC_MINOR__) 49 | # define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__) 50 | # endif 51 | # if defined(__GNUC_PATCHLEVEL__) 52 | # define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) 53 | # endif 54 | 55 | #elif defined(__PATHCC__) 56 | # define COMPILER_ID "PathScale" 57 | # define COMPILER_VERSION_MAJOR DEC(__PATHCC__) 58 | # define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__) 59 | # if defined(__PATHCC_PATCHLEVEL__) 60 | # define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__) 61 | # endif 62 | 63 | #elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__) 64 | # define COMPILER_ID "Embarcadero" 65 | # define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF) 66 | # define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF) 67 | # define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF) 68 | 69 | #elif defined(__BORLANDC__) 70 | # define COMPILER_ID "Borland" 71 | /* __BORLANDC__ = 0xVRR */ 72 | # define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8) 73 | # define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF) 74 | 75 | #elif defined(__WATCOMC__) && __WATCOMC__ < 1200 76 | # define COMPILER_ID "Watcom" 77 | /* __WATCOMC__ = VVRR */ 78 | # define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100) 79 | # define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) 80 | # if (__WATCOMC__ % 10) > 0 81 | # define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) 82 | # endif 83 | 84 | #elif defined(__WATCOMC__) 85 | # define COMPILER_ID "OpenWatcom" 86 | /* __WATCOMC__ = VVRP + 1100 */ 87 | # define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100) 88 | # define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) 89 | # if (__WATCOMC__ % 10) > 0 90 | # define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) 91 | # endif 92 | 93 | #elif defined(__SUNPRO_CC) 94 | # define COMPILER_ID "SunPro" 95 | # if __SUNPRO_CC >= 0x5100 96 | /* __SUNPRO_CC = 0xVRRP */ 97 | # define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>12) 98 | # define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xFF) 99 | # define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF) 100 | # else 101 | /* __SUNPRO_CC = 0xVRP */ 102 | # define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>8) 103 | # define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xF) 104 | # define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF) 105 | # endif 106 | 107 | #elif defined(__HP_aCC) 108 | # define COMPILER_ID "HP" 109 | /* __HP_aCC = VVRRPP */ 110 | # define COMPILER_VERSION_MAJOR DEC(__HP_aCC/10000) 111 | # define COMPILER_VERSION_MINOR DEC(__HP_aCC/100 % 100) 112 | # define COMPILER_VERSION_PATCH DEC(__HP_aCC % 100) 113 | 114 | #elif defined(__DECCXX) 115 | # define COMPILER_ID "Compaq" 116 | /* __DECCXX_VER = VVRRTPPPP */ 117 | # define COMPILER_VERSION_MAJOR DEC(__DECCXX_VER/10000000) 118 | # define COMPILER_VERSION_MINOR DEC(__DECCXX_VER/100000 % 100) 119 | # define COMPILER_VERSION_PATCH DEC(__DECCXX_VER % 10000) 120 | 121 | #elif defined(__IBMCPP__) && defined(__COMPILER_VER__) 122 | # define COMPILER_ID "zOS" 123 | /* __IBMCPP__ = VRP */ 124 | # define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) 125 | # define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) 126 | # define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) 127 | 128 | #elif defined(__ibmxl__) && defined(__clang__) 129 | # define COMPILER_ID "XLClang" 130 | # define COMPILER_VERSION_MAJOR DEC(__ibmxl_version__) 131 | # define COMPILER_VERSION_MINOR DEC(__ibmxl_release__) 132 | # define COMPILER_VERSION_PATCH DEC(__ibmxl_modification__) 133 | # define COMPILER_VERSION_TWEAK DEC(__ibmxl_ptf_fix_level__) 134 | 135 | 136 | #elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ >= 800 137 | # define COMPILER_ID "XL" 138 | /* __IBMCPP__ = VRP */ 139 | # define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) 140 | # define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) 141 | # define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) 142 | 143 | #elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ < 800 144 | # define COMPILER_ID "VisualAge" 145 | /* __IBMCPP__ = VRP */ 146 | # define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) 147 | # define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) 148 | # define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) 149 | 150 | #elif defined(__PGI) 151 | # define COMPILER_ID "PGI" 152 | # define COMPILER_VERSION_MAJOR DEC(__PGIC__) 153 | # define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__) 154 | # if defined(__PGIC_PATCHLEVEL__) 155 | # define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__) 156 | # endif 157 | 158 | #elif defined(_CRAYC) 159 | # define COMPILER_ID "Cray" 160 | # define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR) 161 | # define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR) 162 | 163 | #elif defined(__TI_COMPILER_VERSION__) 164 | # define COMPILER_ID "TI" 165 | /* __TI_COMPILER_VERSION__ = VVVRRRPPP */ 166 | # define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000) 167 | # define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000) 168 | # define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000) 169 | 170 | #elif defined(__FUJITSU) || defined(__FCC_VERSION) || defined(__fcc_version) 171 | # define COMPILER_ID "Fujitsu" 172 | 173 | #elif defined(__ghs__) 174 | # define COMPILER_ID "GHS" 175 | /* __GHS_VERSION_NUMBER = VVVVRP */ 176 | # ifdef __GHS_VERSION_NUMBER 177 | # define COMPILER_VERSION_MAJOR DEC(__GHS_VERSION_NUMBER / 100) 178 | # define COMPILER_VERSION_MINOR DEC(__GHS_VERSION_NUMBER / 10 % 10) 179 | # define COMPILER_VERSION_PATCH DEC(__GHS_VERSION_NUMBER % 10) 180 | # endif 181 | 182 | #elif defined(__SCO_VERSION__) 183 | # define COMPILER_ID "SCO" 184 | 185 | #elif defined(__ARMCC_VERSION) && !defined(__clang__) 186 | # define COMPILER_ID "ARMCC" 187 | #if __ARMCC_VERSION >= 1000000 188 | /* __ARMCC_VERSION = VRRPPPP */ 189 | # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000) 190 | # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100) 191 | # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) 192 | #else 193 | /* __ARMCC_VERSION = VRPPPP */ 194 | # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000) 195 | # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10) 196 | # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) 197 | #endif 198 | 199 | 200 | #elif defined(__clang__) && defined(__apple_build_version__) 201 | # define COMPILER_ID "AppleClang" 202 | # if defined(_MSC_VER) 203 | # define SIMULATE_ID "MSVC" 204 | # endif 205 | # define COMPILER_VERSION_MAJOR DEC(__clang_major__) 206 | # define COMPILER_VERSION_MINOR DEC(__clang_minor__) 207 | # define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) 208 | # if defined(_MSC_VER) 209 | /* _MSC_VER = VVRR */ 210 | # define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) 211 | # define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) 212 | # endif 213 | # define COMPILER_VERSION_TWEAK DEC(__apple_build_version__) 214 | 215 | #elif defined(__clang__) && defined(__ARMCOMPILER_VERSION) 216 | # define COMPILER_ID "ARMClang" 217 | # define COMPILER_VERSION_MAJOR DEC(__ARMCOMPILER_VERSION/1000000) 218 | # define COMPILER_VERSION_MINOR DEC(__ARMCOMPILER_VERSION/10000 % 100) 219 | # define COMPILER_VERSION_PATCH DEC(__ARMCOMPILER_VERSION % 10000) 220 | # define COMPILER_VERSION_INTERNAL DEC(__ARMCOMPILER_VERSION) 221 | 222 | #elif defined(__clang__) 223 | # define COMPILER_ID "Clang" 224 | # if defined(_MSC_VER) 225 | # define SIMULATE_ID "MSVC" 226 | # endif 227 | # define COMPILER_VERSION_MAJOR DEC(__clang_major__) 228 | # define COMPILER_VERSION_MINOR DEC(__clang_minor__) 229 | # define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) 230 | # if defined(_MSC_VER) 231 | /* _MSC_VER = VVRR */ 232 | # define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) 233 | # define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) 234 | # endif 235 | 236 | #elif defined(__GNUC__) || defined(__GNUG__) 237 | # define COMPILER_ID "GNU" 238 | # if defined(__GNUC__) 239 | # define COMPILER_VERSION_MAJOR DEC(__GNUC__) 240 | # else 241 | # define COMPILER_VERSION_MAJOR DEC(__GNUG__) 242 | # endif 243 | # if defined(__GNUC_MINOR__) 244 | # define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__) 245 | # endif 246 | # if defined(__GNUC_PATCHLEVEL__) 247 | # define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) 248 | # endif 249 | 250 | #elif defined(_MSC_VER) 251 | # define COMPILER_ID "MSVC" 252 | /* _MSC_VER = VVRR */ 253 | # define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100) 254 | # define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100) 255 | # if defined(_MSC_FULL_VER) 256 | # if _MSC_VER >= 1400 257 | /* _MSC_FULL_VER = VVRRPPPPP */ 258 | # define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000) 259 | # else 260 | /* _MSC_FULL_VER = VVRRPPPP */ 261 | # define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000) 262 | # endif 263 | # endif 264 | # if defined(_MSC_BUILD) 265 | # define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD) 266 | # endif 267 | 268 | #elif defined(__VISUALDSPVERSION__) || defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__) 269 | # define COMPILER_ID "ADSP" 270 | #if defined(__VISUALDSPVERSION__) 271 | /* __VISUALDSPVERSION__ = 0xVVRRPP00 */ 272 | # define COMPILER_VERSION_MAJOR HEX(__VISUALDSPVERSION__>>24) 273 | # define COMPILER_VERSION_MINOR HEX(__VISUALDSPVERSION__>>16 & 0xFF) 274 | # define COMPILER_VERSION_PATCH HEX(__VISUALDSPVERSION__>>8 & 0xFF) 275 | #endif 276 | 277 | #elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) 278 | # define COMPILER_ID "IAR" 279 | # if defined(__VER__) && defined(__ICCARM__) 280 | # define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000) 281 | # define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000) 282 | # define COMPILER_VERSION_PATCH DEC((__VER__) % 1000) 283 | # define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) 284 | # elif defined(__VER__) && (defined(__ICCAVR__) || defined(__ICCRX__) || defined(__ICCRH850__) || defined(__ICCRL78__) || defined(__ICC430__) || defined(__ICCRISCV__) || defined(__ICCV850__) || defined(__ICC8051__)) 285 | # define COMPILER_VERSION_MAJOR DEC((__VER__) / 100) 286 | # define COMPILER_VERSION_MINOR DEC((__VER__) - (((__VER__) / 100)*100)) 287 | # define COMPILER_VERSION_PATCH DEC(__SUBVERSION__) 288 | # define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) 289 | # endif 290 | 291 | 292 | /* These compilers are either not known or too old to define an 293 | identification macro. Try to identify the platform and guess that 294 | it is the native compiler. */ 295 | #elif defined(__hpux) || defined(__hpua) 296 | # define COMPILER_ID "HP" 297 | 298 | #else /* unknown compiler */ 299 | # define COMPILER_ID "" 300 | #endif 301 | 302 | /* Construct the string literal in pieces to prevent the source from 303 | getting matched. Store it in a pointer rather than an array 304 | because some compilers will just produce instructions to fill the 305 | array rather than assigning a pointer to a static array. */ 306 | char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]"; 307 | #ifdef SIMULATE_ID 308 | char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]"; 309 | #endif 310 | 311 | #ifdef __QNXNTO__ 312 | char const* qnxnto = "INFO" ":" "qnxnto[]"; 313 | #endif 314 | 315 | #if defined(__CRAYXE) || defined(__CRAYXC) 316 | char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]"; 317 | #endif 318 | 319 | #define STRINGIFY_HELPER(X) #X 320 | #define STRINGIFY(X) STRINGIFY_HELPER(X) 321 | 322 | /* Identify known platforms by name. */ 323 | #if defined(__linux) || defined(__linux__) || defined(linux) 324 | # define PLATFORM_ID "Linux" 325 | 326 | #elif defined(__CYGWIN__) 327 | # define PLATFORM_ID "Cygwin" 328 | 329 | #elif defined(__MINGW32__) 330 | # define PLATFORM_ID "MinGW" 331 | 332 | #elif defined(__APPLE__) 333 | # define PLATFORM_ID "Darwin" 334 | 335 | #elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) 336 | # define PLATFORM_ID "Windows" 337 | 338 | #elif defined(__FreeBSD__) || defined(__FreeBSD) 339 | # define PLATFORM_ID "FreeBSD" 340 | 341 | #elif defined(__NetBSD__) || defined(__NetBSD) 342 | # define PLATFORM_ID "NetBSD" 343 | 344 | #elif defined(__OpenBSD__) || defined(__OPENBSD) 345 | # define PLATFORM_ID "OpenBSD" 346 | 347 | #elif defined(__sun) || defined(sun) 348 | # define PLATFORM_ID "SunOS" 349 | 350 | #elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__) 351 | # define PLATFORM_ID "AIX" 352 | 353 | #elif defined(__hpux) || defined(__hpux__) 354 | # define PLATFORM_ID "HP-UX" 355 | 356 | #elif defined(__HAIKU__) 357 | # define PLATFORM_ID "Haiku" 358 | 359 | #elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS) 360 | # define PLATFORM_ID "BeOS" 361 | 362 | #elif defined(__QNX__) || defined(__QNXNTO__) 363 | # define PLATFORM_ID "QNX" 364 | 365 | #elif defined(__tru64) || defined(_tru64) || defined(__TRU64__) 366 | # define PLATFORM_ID "Tru64" 367 | 368 | #elif defined(__riscos) || defined(__riscos__) 369 | # define PLATFORM_ID "RISCos" 370 | 371 | #elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__) 372 | # define PLATFORM_ID "SINIX" 373 | 374 | #elif defined(__UNIX_SV__) 375 | # define PLATFORM_ID "UNIX_SV" 376 | 377 | #elif defined(__bsdos__) 378 | # define PLATFORM_ID "BSDOS" 379 | 380 | #elif defined(_MPRAS) || defined(MPRAS) 381 | # define PLATFORM_ID "MP-RAS" 382 | 383 | #elif defined(__osf) || defined(__osf__) 384 | # define PLATFORM_ID "OSF1" 385 | 386 | #elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv) 387 | # define PLATFORM_ID "SCO_SV" 388 | 389 | #elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX) 390 | # define PLATFORM_ID "ULTRIX" 391 | 392 | #elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX) 393 | # define PLATFORM_ID "Xenix" 394 | 395 | #elif defined(__WATCOMC__) 396 | # if defined(__LINUX__) 397 | # define PLATFORM_ID "Linux" 398 | 399 | # elif defined(__DOS__) 400 | # define PLATFORM_ID "DOS" 401 | 402 | # elif defined(__OS2__) 403 | # define PLATFORM_ID "OS2" 404 | 405 | # elif defined(__WINDOWS__) 406 | # define PLATFORM_ID "Windows3x" 407 | 408 | # else /* unknown platform */ 409 | # define PLATFORM_ID 410 | # endif 411 | 412 | #elif defined(__INTEGRITY) 413 | # if defined(INT_178B) 414 | # define PLATFORM_ID "Integrity178" 415 | 416 | # else /* regular Integrity */ 417 | # define PLATFORM_ID "Integrity" 418 | # endif 419 | 420 | #else /* unknown platform */ 421 | # define PLATFORM_ID 422 | 423 | #endif 424 | 425 | /* For windows compilers MSVC and Intel we can determine 426 | the architecture of the compiler being used. This is because 427 | the compilers do not have flags that can change the architecture, 428 | but rather depend on which compiler is being used 429 | */ 430 | #if defined(_WIN32) && defined(_MSC_VER) 431 | # if defined(_M_IA64) 432 | # define ARCHITECTURE_ID "IA64" 433 | 434 | # elif defined(_M_X64) || defined(_M_AMD64) 435 | # define ARCHITECTURE_ID "x64" 436 | 437 | # elif defined(_M_IX86) 438 | # define ARCHITECTURE_ID "X86" 439 | 440 | # elif defined(_M_ARM64) 441 | # define ARCHITECTURE_ID "ARM64" 442 | 443 | # elif defined(_M_ARM) 444 | # if _M_ARM == 4 445 | # define ARCHITECTURE_ID "ARMV4I" 446 | # elif _M_ARM == 5 447 | # define ARCHITECTURE_ID "ARMV5I" 448 | # else 449 | # define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM) 450 | # endif 451 | 452 | # elif defined(_M_MIPS) 453 | # define ARCHITECTURE_ID "MIPS" 454 | 455 | # elif defined(_M_SH) 456 | # define ARCHITECTURE_ID "SHx" 457 | 458 | # else /* unknown architecture */ 459 | # define ARCHITECTURE_ID "" 460 | # endif 461 | 462 | #elif defined(__WATCOMC__) 463 | # if defined(_M_I86) 464 | # define ARCHITECTURE_ID "I86" 465 | 466 | # elif defined(_M_IX86) 467 | # define ARCHITECTURE_ID "X86" 468 | 469 | # else /* unknown architecture */ 470 | # define ARCHITECTURE_ID "" 471 | # endif 472 | 473 | #elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) 474 | # if defined(__ICCARM__) 475 | # define ARCHITECTURE_ID "ARM" 476 | 477 | # elif defined(__ICCRX__) 478 | # define ARCHITECTURE_ID "RX" 479 | 480 | # elif defined(__ICCRH850__) 481 | # define ARCHITECTURE_ID "RH850" 482 | 483 | # elif defined(__ICCRL78__) 484 | # define ARCHITECTURE_ID "RL78" 485 | 486 | # elif defined(__ICCRISCV__) 487 | # define ARCHITECTURE_ID "RISCV" 488 | 489 | # elif defined(__ICCAVR__) 490 | # define ARCHITECTURE_ID "AVR" 491 | 492 | # elif defined(__ICC430__) 493 | # define ARCHITECTURE_ID "MSP430" 494 | 495 | # elif defined(__ICCV850__) 496 | # define ARCHITECTURE_ID "V850" 497 | 498 | # elif defined(__ICC8051__) 499 | # define ARCHITECTURE_ID "8051" 500 | 501 | # else /* unknown architecture */ 502 | # define ARCHITECTURE_ID "" 503 | # endif 504 | 505 | #elif defined(__ghs__) 506 | # if defined(__PPC64__) 507 | # define ARCHITECTURE_ID "PPC64" 508 | 509 | # elif defined(__ppc__) 510 | # define ARCHITECTURE_ID "PPC" 511 | 512 | # elif defined(__ARM__) 513 | # define ARCHITECTURE_ID "ARM" 514 | 515 | # elif defined(__x86_64__) 516 | # define ARCHITECTURE_ID "x64" 517 | 518 | # elif defined(__i386__) 519 | # define ARCHITECTURE_ID "X86" 520 | 521 | # else /* unknown architecture */ 522 | # define ARCHITECTURE_ID "" 523 | # endif 524 | #else 525 | # define ARCHITECTURE_ID 526 | #endif 527 | 528 | /* Convert integer to decimal digit literals. */ 529 | #define DEC(n) \ 530 | ('0' + (((n) / 10000000)%10)), \ 531 | ('0' + (((n) / 1000000)%10)), \ 532 | ('0' + (((n) / 100000)%10)), \ 533 | ('0' + (((n) / 10000)%10)), \ 534 | ('0' + (((n) / 1000)%10)), \ 535 | ('0' + (((n) / 100)%10)), \ 536 | ('0' + (((n) / 10)%10)), \ 537 | ('0' + ((n) % 10)) 538 | 539 | /* Convert integer to hex digit literals. */ 540 | #define HEX(n) \ 541 | ('0' + ((n)>>28 & 0xF)), \ 542 | ('0' + ((n)>>24 & 0xF)), \ 543 | ('0' + ((n)>>20 & 0xF)), \ 544 | ('0' + ((n)>>16 & 0xF)), \ 545 | ('0' + ((n)>>12 & 0xF)), \ 546 | ('0' + ((n)>>8 & 0xF)), \ 547 | ('0' + ((n)>>4 & 0xF)), \ 548 | ('0' + ((n) & 0xF)) 549 | 550 | /* Construct a string literal encoding the version number components. */ 551 | #ifdef COMPILER_VERSION_MAJOR 552 | char const info_version[] = { 553 | 'I', 'N', 'F', 'O', ':', 554 | 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[', 555 | COMPILER_VERSION_MAJOR, 556 | # ifdef COMPILER_VERSION_MINOR 557 | '.', COMPILER_VERSION_MINOR, 558 | # ifdef COMPILER_VERSION_PATCH 559 | '.', COMPILER_VERSION_PATCH, 560 | # ifdef COMPILER_VERSION_TWEAK 561 | '.', COMPILER_VERSION_TWEAK, 562 | # endif 563 | # endif 564 | # endif 565 | ']','\0'}; 566 | #endif 567 | 568 | /* Construct a string literal encoding the internal version number. */ 569 | #ifdef COMPILER_VERSION_INTERNAL 570 | char const info_version_internal[] = { 571 | 'I', 'N', 'F', 'O', ':', 572 | 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_', 573 | 'i','n','t','e','r','n','a','l','[', 574 | COMPILER_VERSION_INTERNAL,']','\0'}; 575 | #endif 576 | 577 | /* Construct a string literal encoding the version number components. */ 578 | #ifdef SIMULATE_VERSION_MAJOR 579 | char const info_simulate_version[] = { 580 | 'I', 'N', 'F', 'O', ':', 581 | 's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[', 582 | SIMULATE_VERSION_MAJOR, 583 | # ifdef SIMULATE_VERSION_MINOR 584 | '.', SIMULATE_VERSION_MINOR, 585 | # ifdef SIMULATE_VERSION_PATCH 586 | '.', SIMULATE_VERSION_PATCH, 587 | # ifdef SIMULATE_VERSION_TWEAK 588 | '.', SIMULATE_VERSION_TWEAK, 589 | # endif 590 | # endif 591 | # endif 592 | ']','\0'}; 593 | #endif 594 | 595 | /* Construct the string literal in pieces to prevent the source from 596 | getting matched. Store it in a pointer rather than an array 597 | because some compilers will just produce instructions to fill the 598 | array rather than assigning a pointer to a static array. */ 599 | char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]"; 600 | char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]"; 601 | 602 | 603 | 604 | 605 | #if defined(__INTEL_COMPILER) && defined(_MSVC_LANG) && _MSVC_LANG < 201403L 606 | # if defined(__INTEL_CXX11_MODE__) 607 | # if defined(__cpp_aggregate_nsdmi) 608 | # define CXX_STD 201402L 609 | # else 610 | # define CXX_STD 201103L 611 | # endif 612 | # else 613 | # define CXX_STD 199711L 614 | # endif 615 | #elif defined(_MSC_VER) && defined(_MSVC_LANG) 616 | # define CXX_STD _MSVC_LANG 617 | #else 618 | # define CXX_STD __cplusplus 619 | #endif 620 | 621 | const char* info_language_dialect_default = "INFO" ":" "dialect_default[" 622 | #if CXX_STD > 201703L 623 | "20" 624 | #elif CXX_STD >= 201703L 625 | "17" 626 | #elif CXX_STD >= 201402L 627 | "14" 628 | #elif CXX_STD >= 201103L 629 | "11" 630 | #else 631 | "98" 632 | #endif 633 | "]"; 634 | 635 | /*--------------------------------------------------------------------------*/ 636 | 637 | int main(int argc, char* argv[]) 638 | { 639 | int require = 0; 640 | require += info_compiler[argc]; 641 | require += info_platform[argc]; 642 | #ifdef COMPILER_VERSION_MAJOR 643 | require += info_version[argc]; 644 | #endif 645 | #ifdef COMPILER_VERSION_INTERNAL 646 | require += info_version_internal[argc]; 647 | #endif 648 | #ifdef SIMULATE_ID 649 | require += info_simulate[argc]; 650 | #endif 651 | #ifdef SIMULATE_VERSION_MAJOR 652 | require += info_simulate_version[argc]; 653 | #endif 654 | #if defined(__CRAYXE) || defined(__CRAYXC) 655 | require += info_cray[argc]; 656 | #endif 657 | require += info_language_dialect_default[argc]; 658 | (void)argv; 659 | return require; 660 | } 661 | -------------------------------------------------------------------------------- /Course_Design_Fifth/cmake-build-debug/CMakeFiles/3.17.5/CompilerIdCXX/a.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Travis1024/Course_Code/1e64ed19cd5a0d3c14891cf8eb8d771e5cd13bf8/Course_Design_Fifth/cmake-build-debug/CMakeFiles/3.17.5/CompilerIdCXX/a.exe -------------------------------------------------------------------------------- /Course_Design_Fifth/cmake-build-debug/CMakeFiles/CMakeDirectoryInformation.cmake: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "MinGW Makefiles" Generator, CMake Version 3.17 3 | 4 | # Relative path conversion top directories. 5 | set(CMAKE_RELATIVE_PATH_TOP_SOURCE "F:/Clion file/Course_Design_Fifth") 6 | set(CMAKE_RELATIVE_PATH_TOP_BINARY "F:/Clion file/Course_Design_Fifth/cmake-build-debug") 7 | 8 | # Force unix paths in dependencies. 9 | set(CMAKE_FORCE_UNIX_PATHS 1) 10 | 11 | 12 | # The C and CXX include file regular expressions for this directory. 13 | set(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$") 14 | set(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$") 15 | set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN}) 16 | set(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN}) 17 | -------------------------------------------------------------------------------- /Course_Design_Fifth/cmake-build-debug/CMakeFiles/Course_Design_Fifth.dir/CXX.includecache: -------------------------------------------------------------------------------- 1 | #IncludeRegexLine: ^[ ]*[#%][ ]*(include|import)[ ]*[<"]([^">]+)([">]) 2 | 3 | #IncludeRegexScan: ^.*$ 4 | 5 | #IncludeRegexComplain: ^$ 6 | 7 | #IncludeRegexTransform: 8 | 9 | F:/Clion file/Course_Design_Fifth/main.cpp 10 | iostream 11 | - 12 | sstream 13 | - 14 | fstream 15 | - 16 | string 17 | - 18 | stdio.h 19 | - 20 | string.h 21 | - 22 | deque 23 | - 24 | map 25 | - 26 | 27 | -------------------------------------------------------------------------------- /Course_Design_Fifth/cmake-build-debug/CMakeFiles/Course_Design_Fifth.dir/DependInfo.cmake: -------------------------------------------------------------------------------- 1 | # The set of languages for which implicit dependencies are needed: 2 | set(CMAKE_DEPENDS_LANGUAGES 3 | "CXX" 4 | ) 5 | # The set of files for implicit dependencies of each language: 6 | set(CMAKE_DEPENDS_CHECK_CXX 7 | "F:/Clion file/Course_Design_Fifth/main.cpp" "F:/Clion file/Course_Design_Fifth/cmake-build-debug/CMakeFiles/Course_Design_Fifth.dir/main.cpp.obj" 8 | ) 9 | set(CMAKE_CXX_COMPILER_ID "GNU") 10 | 11 | # The include file search paths: 12 | set(CMAKE_CXX_TARGET_INCLUDE_PATH 13 | ) 14 | 15 | # Targets to which this target links. 16 | set(CMAKE_TARGET_LINKED_INFO_FILES 17 | ) 18 | 19 | # Fortran module output directory. 20 | set(CMAKE_Fortran_TARGET_MODULE_DIR "") 21 | -------------------------------------------------------------------------------- /Course_Design_Fifth/cmake-build-debug/CMakeFiles/Course_Design_Fifth.dir/build.make: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "MinGW Makefiles" Generator, CMake Version 3.17 3 | 4 | # Delete rule output on recipe failure. 5 | .DELETE_ON_ERROR: 6 | 7 | 8 | #============================================================================= 9 | # Special targets provided by cmake. 10 | 11 | # Disable implicit rules so canonical targets will work. 12 | .SUFFIXES: 13 | 14 | 15 | # Disable VCS-based implicit rules. 16 | % : %,v 17 | 18 | 19 | # Disable VCS-based implicit rules. 20 | % : RCS/% 21 | 22 | 23 | # Disable VCS-based implicit rules. 24 | % : RCS/%,v 25 | 26 | 27 | # Disable VCS-based implicit rules. 28 | % : SCCS/s.% 29 | 30 | 31 | # Disable VCS-based implicit rules. 32 | % : s.% 33 | 34 | 35 | .SUFFIXES: .hpux_make_needs_suffix_list 36 | 37 | 38 | # Command-line flag to silence nested $(MAKE). 39 | $(VERBOSE)MAKESILENT = -s 40 | 41 | # Suppress display of executed commands. 42 | $(VERBOSE).SILENT: 43 | 44 | 45 | # A target that is always out of date. 46 | cmake_force: 47 | 48 | .PHONY : cmake_force 49 | 50 | #============================================================================= 51 | # Set environment variables for the build. 52 | 53 | SHELL = cmd.exe 54 | 55 | # The CMake executable. 56 | CMAKE_COMMAND = "F:\clion\CLion 2020.3\bin\cmake\win\bin\cmake.exe" 57 | 58 | # The command to remove a file. 59 | RM = "F:\clion\CLion 2020.3\bin\cmake\win\bin\cmake.exe" -E rm -f 60 | 61 | # Escaping for special characters. 62 | EQUALS = = 63 | 64 | # The top-level source directory on which CMake was run. 65 | CMAKE_SOURCE_DIR = "F:\Clion file\Course_Design_Fifth" 66 | 67 | # The top-level build directory on which CMake was run. 68 | CMAKE_BINARY_DIR = "F:\Clion file\Course_Design_Fifth\cmake-build-debug" 69 | 70 | # Include any dependencies generated for this target. 71 | include CMakeFiles/Course_Design_Fifth.dir/depend.make 72 | 73 | # Include the progress variables for this target. 74 | include CMakeFiles/Course_Design_Fifth.dir/progress.make 75 | 76 | # Include the compile flags for this target's objects. 77 | include CMakeFiles/Course_Design_Fifth.dir/flags.make 78 | 79 | CMakeFiles/Course_Design_Fifth.dir/main.cpp.obj: CMakeFiles/Course_Design_Fifth.dir/flags.make 80 | CMakeFiles/Course_Design_Fifth.dir/main.cpp.obj: ../main.cpp 81 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir="F:\Clion file\Course_Design_Fifth\cmake-build-debug\CMakeFiles" --progress-num=$(CMAKE_PROGRESS_1) "Building CXX object CMakeFiles/Course_Design_Fifth.dir/main.cpp.obj" 82 | G:\MinGw_new\mingw64\bin\g++.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles\Course_Design_Fifth.dir\main.cpp.obj -c "F:\Clion file\Course_Design_Fifth\main.cpp" 83 | 84 | CMakeFiles/Course_Design_Fifth.dir/main.cpp.i: cmake_force 85 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/Course_Design_Fifth.dir/main.cpp.i" 86 | G:\MinGw_new\mingw64\bin\g++.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E "F:\Clion file\Course_Design_Fifth\main.cpp" > CMakeFiles\Course_Design_Fifth.dir\main.cpp.i 87 | 88 | CMakeFiles/Course_Design_Fifth.dir/main.cpp.s: cmake_force 89 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/Course_Design_Fifth.dir/main.cpp.s" 90 | G:\MinGw_new\mingw64\bin\g++.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S "F:\Clion file\Course_Design_Fifth\main.cpp" -o CMakeFiles\Course_Design_Fifth.dir\main.cpp.s 91 | 92 | # Object files for target Course_Design_Fifth 93 | Course_Design_Fifth_OBJECTS = \ 94 | "CMakeFiles/Course_Design_Fifth.dir/main.cpp.obj" 95 | 96 | # External object files for target Course_Design_Fifth 97 | Course_Design_Fifth_EXTERNAL_OBJECTS = 98 | 99 | Course_Design_Fifth.exe: CMakeFiles/Course_Design_Fifth.dir/main.cpp.obj 100 | Course_Design_Fifth.exe: CMakeFiles/Course_Design_Fifth.dir/build.make 101 | Course_Design_Fifth.exe: CMakeFiles/Course_Design_Fifth.dir/linklibs.rsp 102 | Course_Design_Fifth.exe: CMakeFiles/Course_Design_Fifth.dir/objects1.rsp 103 | Course_Design_Fifth.exe: CMakeFiles/Course_Design_Fifth.dir/link.txt 104 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --bold --progress-dir="F:\Clion file\Course_Design_Fifth\cmake-build-debug\CMakeFiles" --progress-num=$(CMAKE_PROGRESS_2) "Linking CXX executable Course_Design_Fifth.exe" 105 | $(CMAKE_COMMAND) -E cmake_link_script CMakeFiles\Course_Design_Fifth.dir\link.txt --verbose=$(VERBOSE) 106 | 107 | # Rule to build all files generated by this target. 108 | CMakeFiles/Course_Design_Fifth.dir/build: Course_Design_Fifth.exe 109 | 110 | .PHONY : CMakeFiles/Course_Design_Fifth.dir/build 111 | 112 | CMakeFiles/Course_Design_Fifth.dir/clean: 113 | $(CMAKE_COMMAND) -P CMakeFiles\Course_Design_Fifth.dir\cmake_clean.cmake 114 | .PHONY : CMakeFiles/Course_Design_Fifth.dir/clean 115 | 116 | CMakeFiles/Course_Design_Fifth.dir/depend: 117 | $(CMAKE_COMMAND) -E cmake_depends "MinGW Makefiles" "F:\Clion file\Course_Design_Fifth" "F:\Clion file\Course_Design_Fifth" "F:\Clion file\Course_Design_Fifth\cmake-build-debug" "F:\Clion file\Course_Design_Fifth\cmake-build-debug" "F:\Clion file\Course_Design_Fifth\cmake-build-debug\CMakeFiles\Course_Design_Fifth.dir\DependInfo.cmake" --color=$(COLOR) 118 | .PHONY : CMakeFiles/Course_Design_Fifth.dir/depend 119 | 120 | -------------------------------------------------------------------------------- /Course_Design_Fifth/cmake-build-debug/CMakeFiles/Course_Design_Fifth.dir/cmake_clean.cmake: -------------------------------------------------------------------------------- 1 | file(REMOVE_RECURSE 2 | "CMakeFiles/Course_Design_Fifth.dir/main.cpp.obj" 3 | "Course_Design_Fifth.exe" 4 | "Course_Design_Fifth.exe.manifest" 5 | "Course_Design_Fifth.pdb" 6 | "libCourse_Design_Fifth.dll.a" 7 | ) 8 | 9 | # Per-language clean rules from dependency scanning. 10 | foreach(lang CXX) 11 | include(CMakeFiles/Course_Design_Fifth.dir/cmake_clean_${lang}.cmake OPTIONAL) 12 | endforeach() 13 | -------------------------------------------------------------------------------- /Course_Design_Fifth/cmake-build-debug/CMakeFiles/Course_Design_Fifth.dir/depend.internal: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "MinGW Makefiles" Generator, CMake Version 3.17 3 | 4 | CMakeFiles/Course_Design_Fifth.dir/main.cpp.obj 5 | F:/Clion file/Course_Design_Fifth/main.cpp 6 | -------------------------------------------------------------------------------- /Course_Design_Fifth/cmake-build-debug/CMakeFiles/Course_Design_Fifth.dir/depend.make: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "MinGW Makefiles" Generator, CMake Version 3.17 3 | 4 | CMakeFiles/Course_Design_Fifth.dir/main.cpp.obj: ../main.cpp 5 | 6 | -------------------------------------------------------------------------------- /Course_Design_Fifth/cmake-build-debug/CMakeFiles/Course_Design_Fifth.dir/flags.make: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "MinGW Makefiles" Generator, CMake Version 3.17 3 | 4 | # compile CXX with G:/MinGw_new/mingw64/bin/g++.exe 5 | CXX_FLAGS = -g -std=gnu++14 6 | 7 | CXX_DEFINES = 8 | 9 | CXX_INCLUDES = 10 | 11 | -------------------------------------------------------------------------------- /Course_Design_Fifth/cmake-build-debug/CMakeFiles/Course_Design_Fifth.dir/link.txt: -------------------------------------------------------------------------------- 1 | "F:\clion\CLion 2020.3\bin\cmake\win\bin\cmake.exe" -E rm -f CMakeFiles\Course_Design_Fifth.dir/objects.a 2 | G:\MinGw_new\mingw64\bin\ar.exe cr CMakeFiles\Course_Design_Fifth.dir/objects.a @CMakeFiles\Course_Design_Fifth.dir\objects1.rsp 3 | G:\MinGw_new\mingw64\bin\g++.exe -g -Wl,--whole-archive CMakeFiles\Course_Design_Fifth.dir/objects.a -Wl,--no-whole-archive -o Course_Design_Fifth.exe -Wl,--out-implib,libCourse_Design_Fifth.dll.a -Wl,--major-image-version,0,--minor-image-version,0 @CMakeFiles\Course_Design_Fifth.dir\linklibs.rsp 4 | -------------------------------------------------------------------------------- /Course_Design_Fifth/cmake-build-debug/CMakeFiles/Course_Design_Fifth.dir/linklibs.rsp: -------------------------------------------------------------------------------- 1 | -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 2 | -------------------------------------------------------------------------------- /Course_Design_Fifth/cmake-build-debug/CMakeFiles/Course_Design_Fifth.dir/main.cpp.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Travis1024/Course_Code/1e64ed19cd5a0d3c14891cf8eb8d771e5cd13bf8/Course_Design_Fifth/cmake-build-debug/CMakeFiles/Course_Design_Fifth.dir/main.cpp.obj -------------------------------------------------------------------------------- /Course_Design_Fifth/cmake-build-debug/CMakeFiles/Course_Design_Fifth.dir/objects.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Travis1024/Course_Code/1e64ed19cd5a0d3c14891cf8eb8d771e5cd13bf8/Course_Design_Fifth/cmake-build-debug/CMakeFiles/Course_Design_Fifth.dir/objects.a -------------------------------------------------------------------------------- /Course_Design_Fifth/cmake-build-debug/CMakeFiles/Course_Design_Fifth.dir/objects1.rsp: -------------------------------------------------------------------------------- 1 | CMakeFiles/Course_Design_Fifth.dir/main.cpp.obj 2 | -------------------------------------------------------------------------------- /Course_Design_Fifth/cmake-build-debug/CMakeFiles/Course_Design_Fifth.dir/progress.make: -------------------------------------------------------------------------------- 1 | CMAKE_PROGRESS_1 = 1 2 | CMAKE_PROGRESS_2 = 2 3 | 4 | -------------------------------------------------------------------------------- /Course_Design_Fifth/cmake-build-debug/CMakeFiles/Makefile.cmake: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "MinGW Makefiles" Generator, CMake Version 3.17 3 | 4 | # The generator used is: 5 | set(CMAKE_DEPENDS_GENERATOR "MinGW Makefiles") 6 | 7 | # The top level Makefile was generated from the following files: 8 | set(CMAKE_MAKEFILE_DEPENDS 9 | "CMakeCache.txt" 10 | "../CMakeLists.txt" 11 | "CMakeFiles/3.17.5/CMakeCCompiler.cmake" 12 | "CMakeFiles/3.17.5/CMakeCXXCompiler.cmake" 13 | "CMakeFiles/3.17.5/CMakeRCCompiler.cmake" 14 | "CMakeFiles/3.17.5/CMakeSystem.cmake" 15 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/CMakeCCompiler.cmake.in" 16 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/CMakeCCompilerABI.c" 17 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/CMakeCInformation.cmake" 18 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/CMakeCXXCompiler.cmake.in" 19 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/CMakeCXXCompilerABI.cpp" 20 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/CMakeCXXInformation.cmake" 21 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/CMakeCheckCompilerFlagCommonPatterns.cmake" 22 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/CMakeCommonLanguageInclude.cmake" 23 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/CMakeCompilerIdDetection.cmake" 24 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/CMakeDetermineCCompiler.cmake" 25 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/CMakeDetermineCXXCompiler.cmake" 26 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/CMakeDetermineCompileFeatures.cmake" 27 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/CMakeDetermineCompiler.cmake" 28 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/CMakeDetermineCompilerABI.cmake" 29 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/CMakeDetermineCompilerId.cmake" 30 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/CMakeDetermineRCCompiler.cmake" 31 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/CMakeDetermineSystem.cmake" 32 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake" 33 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/CMakeFindBinUtils.cmake" 34 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/CMakeFindCodeBlocks.cmake" 35 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/CMakeGenericSystem.cmake" 36 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/CMakeInitializeConfigs.cmake" 37 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/CMakeLanguageInformation.cmake" 38 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/CMakeMinGWFindMake.cmake" 39 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/CMakeParseImplicitIncludeInfo.cmake" 40 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/CMakeParseImplicitLinkInfo.cmake" 41 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/CMakeRCCompiler.cmake.in" 42 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/CMakeRCInformation.cmake" 43 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/CMakeSystem.cmake.in" 44 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/CMakeSystemSpecificInformation.cmake" 45 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/CMakeSystemSpecificInitialize.cmake" 46 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/CMakeTestCCompiler.cmake" 47 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/CMakeTestCXXCompiler.cmake" 48 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/CMakeTestCompilerCommon.cmake" 49 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/CMakeTestRCCompiler.cmake" 50 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/Compiler/ADSP-DetermineCompiler.cmake" 51 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/Compiler/ARMCC-DetermineCompiler.cmake" 52 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/Compiler/ARMClang-DetermineCompiler.cmake" 53 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/Compiler/AppleClang-DetermineCompiler.cmake" 54 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/Compiler/Borland-DetermineCompiler.cmake" 55 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/Compiler/Bruce-C-DetermineCompiler.cmake" 56 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/Compiler/CMakeCommonCompilerMacros.cmake" 57 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/Compiler/Clang-DetermineCompiler.cmake" 58 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/Compiler/Clang-DetermineCompilerInternal.cmake" 59 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/Compiler/Comeau-CXX-DetermineCompiler.cmake" 60 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/Compiler/Compaq-C-DetermineCompiler.cmake" 61 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/Compiler/Compaq-CXX-DetermineCompiler.cmake" 62 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/Compiler/Cray-DetermineCompiler.cmake" 63 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/Compiler/Embarcadero-DetermineCompiler.cmake" 64 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/Compiler/Fujitsu-DetermineCompiler.cmake" 65 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/Compiler/GHS-DetermineCompiler.cmake" 66 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/Compiler/GNU-C-DetermineCompiler.cmake" 67 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/Compiler/GNU-C.cmake" 68 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/Compiler/GNU-CXX-DetermineCompiler.cmake" 69 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/Compiler/GNU-CXX.cmake" 70 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/Compiler/GNU-FindBinUtils.cmake" 71 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/Compiler/GNU.cmake" 72 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/Compiler/HP-C-DetermineCompiler.cmake" 73 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/Compiler/HP-CXX-DetermineCompiler.cmake" 74 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/Compiler/IAR-DetermineCompiler.cmake" 75 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/Compiler/IBMCPP-C-DetermineVersionInternal.cmake" 76 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/Compiler/IBMCPP-CXX-DetermineVersionInternal.cmake" 77 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/Compiler/Intel-DetermineCompiler.cmake" 78 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/Compiler/MSVC-DetermineCompiler.cmake" 79 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/Compiler/NVIDIA-DetermineCompiler.cmake" 80 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/Compiler/OpenWatcom-DetermineCompiler.cmake" 81 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/Compiler/PGI-DetermineCompiler.cmake" 82 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/Compiler/PathScale-DetermineCompiler.cmake" 83 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/Compiler/SCO-DetermineCompiler.cmake" 84 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/Compiler/SDCC-C-DetermineCompiler.cmake" 85 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/Compiler/SunPro-C-DetermineCompiler.cmake" 86 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/Compiler/SunPro-CXX-DetermineCompiler.cmake" 87 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/Compiler/TI-DetermineCompiler.cmake" 88 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/Compiler/TinyCC-C-DetermineCompiler.cmake" 89 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/Compiler/VisualAge-C-DetermineCompiler.cmake" 90 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/Compiler/VisualAge-CXX-DetermineCompiler.cmake" 91 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/Compiler/Watcom-DetermineCompiler.cmake" 92 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/Compiler/XL-C-DetermineCompiler.cmake" 93 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/Compiler/XL-CXX-DetermineCompiler.cmake" 94 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/Compiler/XLClang-C-DetermineCompiler.cmake" 95 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/Compiler/XLClang-CXX-DetermineCompiler.cmake" 96 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/Compiler/zOS-C-DetermineCompiler.cmake" 97 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/Compiler/zOS-CXX-DetermineCompiler.cmake" 98 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/Internal/CMakeCheckCompilerFlag.cmake" 99 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/Internal/FeatureTesting.cmake" 100 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/Platform/Windows-Determine-CXX.cmake" 101 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/Platform/Windows-GNU-C-ABI.cmake" 102 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/Platform/Windows-GNU-C.cmake" 103 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/Platform/Windows-GNU-CXX-ABI.cmake" 104 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/Platform/Windows-GNU-CXX.cmake" 105 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/Platform/Windows-GNU.cmake" 106 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/Platform/Windows-windres.cmake" 107 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/Platform/Windows.cmake" 108 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/Platform/WindowsPaths.cmake" 109 | "F:/clion/CLion 2020.3/bin/cmake/win/share/cmake-3.17/Modules/ProcessorCount.cmake" 110 | ) 111 | 112 | # The corresponding makefile is: 113 | set(CMAKE_MAKEFILE_OUTPUTS 114 | "Makefile" 115 | "CMakeFiles/cmake.check_cache" 116 | ) 117 | 118 | # Byproducts of CMake generate step: 119 | set(CMAKE_MAKEFILE_PRODUCTS 120 | "CMakeFiles/3.17.5/CMakeSystem.cmake" 121 | "CMakeFiles/3.17.5/CMakeCCompiler.cmake" 122 | "CMakeFiles/3.17.5/CMakeCXXCompiler.cmake" 123 | "CMakeFiles/3.17.5/CMakeRCCompiler.cmake" 124 | "CMakeFiles/3.17.5/CMakeCCompiler.cmake" 125 | "CMakeFiles/3.17.5/CMakeCXXCompiler.cmake" 126 | "CMakeFiles/CMakeDirectoryInformation.cmake" 127 | ) 128 | 129 | # Dependency information for all targets: 130 | set(CMAKE_DEPEND_INFO_FILES 131 | "CMakeFiles/Course_Design_Fifth.dir/DependInfo.cmake" 132 | ) 133 | -------------------------------------------------------------------------------- /Course_Design_Fifth/cmake-build-debug/CMakeFiles/Makefile2: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "MinGW Makefiles" Generator, CMake Version 3.17 3 | 4 | # Default target executed when no arguments are given to make. 5 | default_target: all 6 | 7 | .PHONY : default_target 8 | 9 | #============================================================================= 10 | # Special targets provided by cmake. 11 | 12 | # Disable implicit rules so canonical targets will work. 13 | .SUFFIXES: 14 | 15 | 16 | # Disable VCS-based implicit rules. 17 | % : %,v 18 | 19 | 20 | # Disable VCS-based implicit rules. 21 | % : RCS/% 22 | 23 | 24 | # Disable VCS-based implicit rules. 25 | % : RCS/%,v 26 | 27 | 28 | # Disable VCS-based implicit rules. 29 | % : SCCS/s.% 30 | 31 | 32 | # Disable VCS-based implicit rules. 33 | % : s.% 34 | 35 | 36 | .SUFFIXES: .hpux_make_needs_suffix_list 37 | 38 | 39 | # Command-line flag to silence nested $(MAKE). 40 | $(VERBOSE)MAKESILENT = -s 41 | 42 | # Suppress display of executed commands. 43 | $(VERBOSE).SILENT: 44 | 45 | 46 | # A target that is always out of date. 47 | cmake_force: 48 | 49 | .PHONY : cmake_force 50 | 51 | #============================================================================= 52 | # Set environment variables for the build. 53 | 54 | SHELL = cmd.exe 55 | 56 | # The CMake executable. 57 | CMAKE_COMMAND = "F:\clion\CLion 2020.3\bin\cmake\win\bin\cmake.exe" 58 | 59 | # The command to remove a file. 60 | RM = "F:\clion\CLion 2020.3\bin\cmake\win\bin\cmake.exe" -E rm -f 61 | 62 | # Escaping for special characters. 63 | EQUALS = = 64 | 65 | # The top-level source directory on which CMake was run. 66 | CMAKE_SOURCE_DIR = "F:\Clion file\Course_Design_Fifth" 67 | 68 | # The top-level build directory on which CMake was run. 69 | CMAKE_BINARY_DIR = "F:\Clion file\Course_Design_Fifth\cmake-build-debug" 70 | 71 | #============================================================================= 72 | # Directory level rules for the build root directory 73 | 74 | # The main recursive "all" target. 75 | all: CMakeFiles/Course_Design_Fifth.dir/all 76 | 77 | .PHONY : all 78 | 79 | # The main recursive "preinstall" target. 80 | preinstall: 81 | 82 | .PHONY : preinstall 83 | 84 | # The main recursive "clean" target. 85 | clean: CMakeFiles/Course_Design_Fifth.dir/clean 86 | 87 | .PHONY : clean 88 | 89 | #============================================================================= 90 | # Target rules for target CMakeFiles/Course_Design_Fifth.dir 91 | 92 | # All Build rule for target. 93 | CMakeFiles/Course_Design_Fifth.dir/all: 94 | $(MAKE) $(MAKESILENT) -f CMakeFiles\Course_Design_Fifth.dir\build.make CMakeFiles/Course_Design_Fifth.dir/depend 95 | $(MAKE) $(MAKESILENT) -f CMakeFiles\Course_Design_Fifth.dir\build.make CMakeFiles/Course_Design_Fifth.dir/build 96 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --progress-dir="F:\Clion file\Course_Design_Fifth\cmake-build-debug\CMakeFiles" --progress-num=1,2 "Built target Course_Design_Fifth" 97 | .PHONY : CMakeFiles/Course_Design_Fifth.dir/all 98 | 99 | # Build rule for subdir invocation for target. 100 | CMakeFiles/Course_Design_Fifth.dir/rule: cmake_check_build_system 101 | $(CMAKE_COMMAND) -E cmake_progress_start "F:\Clion file\Course_Design_Fifth\cmake-build-debug\CMakeFiles" 2 102 | $(MAKE) $(MAKESILENT) -f CMakeFiles\Makefile2 CMakeFiles/Course_Design_Fifth.dir/all 103 | $(CMAKE_COMMAND) -E cmake_progress_start "F:\Clion file\Course_Design_Fifth\cmake-build-debug\CMakeFiles" 0 104 | .PHONY : CMakeFiles/Course_Design_Fifth.dir/rule 105 | 106 | # Convenience name for target. 107 | Course_Design_Fifth: CMakeFiles/Course_Design_Fifth.dir/rule 108 | 109 | .PHONY : Course_Design_Fifth 110 | 111 | # clean rule for target. 112 | CMakeFiles/Course_Design_Fifth.dir/clean: 113 | $(MAKE) $(MAKESILENT) -f CMakeFiles\Course_Design_Fifth.dir\build.make CMakeFiles/Course_Design_Fifth.dir/clean 114 | .PHONY : CMakeFiles/Course_Design_Fifth.dir/clean 115 | 116 | #============================================================================= 117 | # Special targets to cleanup operation of make. 118 | 119 | # Special rule to run CMake to check the build system integrity. 120 | # No rule that depends on this can have commands that come from listfiles 121 | # because they might be regenerated. 122 | cmake_check_build_system: 123 | $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles\Makefile.cmake 0 124 | .PHONY : cmake_check_build_system 125 | 126 | -------------------------------------------------------------------------------- /Course_Design_Fifth/cmake-build-debug/CMakeFiles/TargetDirectories.txt: -------------------------------------------------------------------------------- 1 | F:/Clion file/Course_Design_Fifth/cmake-build-debug/CMakeFiles/Course_Design_Fifth.dir 2 | F:/Clion file/Course_Design_Fifth/cmake-build-debug/CMakeFiles/edit_cache.dir 3 | F:/Clion file/Course_Design_Fifth/cmake-build-debug/CMakeFiles/rebuild_cache.dir 4 | -------------------------------------------------------------------------------- /Course_Design_Fifth/cmake-build-debug/CMakeFiles/clion-environment.txt: -------------------------------------------------------------------------------- 1 | ToolSet: w64 6.0 (local)@G:\MinGw_new\mingw64 2 | Options: 3 | 4 | Options: -------------------------------------------------------------------------------- /Course_Design_Fifth/cmake-build-debug/CMakeFiles/clion-log.txt: -------------------------------------------------------------------------------- 1 | "F:\clion\CLion 2020.3\bin\cmake\win\bin\cmake.exe" -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - MinGW Makefiles" "F:\Clion file\Course_Design_Fifth" 2 | -- The C compiler identification is GNU 8.1.0 3 | -- The CXX compiler identification is GNU 8.1.0 4 | -- Check for working C compiler: G:/MinGw_new/mingw64/bin/gcc.exe 5 | -- Check for working C compiler: G:/MinGw_new/mingw64/bin/gcc.exe - works 6 | -- Detecting C compiler ABI info 7 | -- Detecting C compiler ABI info - done 8 | -- Detecting C compile features 9 | -- Detecting C compile features - done 10 | -- Check for working CXX compiler: G:/MinGw_new/mingw64/bin/g++.exe 11 | -- Check for working CXX compiler: G:/MinGw_new/mingw64/bin/g++.exe - works 12 | -- Detecting CXX compiler ABI info 13 | -- Detecting CXX compiler ABI info - done 14 | -- Detecting CXX compile features 15 | -- Detecting CXX compile features - done 16 | -- Configuring done 17 | -- Generating done 18 | -- Build files have been written to: F:/Clion file/Course_Design_Fifth/cmake-build-debug 19 | -------------------------------------------------------------------------------- /Course_Design_Fifth/cmake-build-debug/CMakeFiles/cmake.check_cache: -------------------------------------------------------------------------------- 1 | # This file is generated by cmake for dependency checking of the CMakeCache.txt file 2 | -------------------------------------------------------------------------------- /Course_Design_Fifth/cmake-build-debug/CMakeFiles/progress.marks: -------------------------------------------------------------------------------- 1 | 2 2 | -------------------------------------------------------------------------------- /Course_Design_Fifth/cmake-build-debug/Course_Design_Fifth.cbp: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 90 | 91 | -------------------------------------------------------------------------------- /Course_Design_Fifth/cmake-build-debug/Course_Design_Fifth.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Travis1024/Course_Code/1e64ed19cd5a0d3c14891cf8eb8d771e5cd13bf8/Course_Design_Fifth/cmake-build-debug/Course_Design_Fifth.exe -------------------------------------------------------------------------------- /Course_Design_Fifth/cmake-build-debug/Makefile: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "MinGW Makefiles" Generator, CMake Version 3.17 3 | 4 | # Default target executed when no arguments are given to make. 5 | default_target: all 6 | 7 | .PHONY : default_target 8 | 9 | # Allow only one "make -f Makefile2" at a time, but pass parallelism. 10 | .NOTPARALLEL: 11 | 12 | 13 | #============================================================================= 14 | # Special targets provided by cmake. 15 | 16 | # Disable implicit rules so canonical targets will work. 17 | .SUFFIXES: 18 | 19 | 20 | # Disable VCS-based implicit rules. 21 | % : %,v 22 | 23 | 24 | # Disable VCS-based implicit rules. 25 | % : RCS/% 26 | 27 | 28 | # Disable VCS-based implicit rules. 29 | % : RCS/%,v 30 | 31 | 32 | # Disable VCS-based implicit rules. 33 | % : SCCS/s.% 34 | 35 | 36 | # Disable VCS-based implicit rules. 37 | % : s.% 38 | 39 | 40 | .SUFFIXES: .hpux_make_needs_suffix_list 41 | 42 | 43 | # Command-line flag to silence nested $(MAKE). 44 | $(VERBOSE)MAKESILENT = -s 45 | 46 | # Suppress display of executed commands. 47 | $(VERBOSE).SILENT: 48 | 49 | 50 | # A target that is always out of date. 51 | cmake_force: 52 | 53 | .PHONY : cmake_force 54 | 55 | #============================================================================= 56 | # Set environment variables for the build. 57 | 58 | SHELL = cmd.exe 59 | 60 | # The CMake executable. 61 | CMAKE_COMMAND = "F:\clion\CLion 2020.3\bin\cmake\win\bin\cmake.exe" 62 | 63 | # The command to remove a file. 64 | RM = "F:\clion\CLion 2020.3\bin\cmake\win\bin\cmake.exe" -E rm -f 65 | 66 | # Escaping for special characters. 67 | EQUALS = = 68 | 69 | # The top-level source directory on which CMake was run. 70 | CMAKE_SOURCE_DIR = "F:\Clion file\Course_Design_Fifth" 71 | 72 | # The top-level build directory on which CMake was run. 73 | CMAKE_BINARY_DIR = "F:\Clion file\Course_Design_Fifth\cmake-build-debug" 74 | 75 | #============================================================================= 76 | # Targets provided globally by CMake. 77 | 78 | # Special rule for the target edit_cache 79 | edit_cache: 80 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "No interactive CMake dialog available..." 81 | "F:\clion\CLion 2020.3\bin\cmake\win\bin\cmake.exe" -E echo "No interactive CMake dialog available." 82 | .PHONY : edit_cache 83 | 84 | # Special rule for the target edit_cache 85 | edit_cache/fast: edit_cache 86 | 87 | .PHONY : edit_cache/fast 88 | 89 | # Special rule for the target rebuild_cache 90 | rebuild_cache: 91 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." 92 | "F:\clion\CLion 2020.3\bin\cmake\win\bin\cmake.exe" --regenerate-during-build -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) 93 | .PHONY : rebuild_cache 94 | 95 | # Special rule for the target rebuild_cache 96 | rebuild_cache/fast: rebuild_cache 97 | 98 | .PHONY : rebuild_cache/fast 99 | 100 | # The main all target 101 | all: cmake_check_build_system 102 | $(CMAKE_COMMAND) -E cmake_progress_start "F:\Clion file\Course_Design_Fifth\cmake-build-debug\CMakeFiles" "F:\Clion file\Course_Design_Fifth\cmake-build-debug\CMakeFiles\progress.marks" 103 | $(MAKE) $(MAKESILENT) -f CMakeFiles\Makefile2 all 104 | $(CMAKE_COMMAND) -E cmake_progress_start "F:\Clion file\Course_Design_Fifth\cmake-build-debug\CMakeFiles" 0 105 | .PHONY : all 106 | 107 | # The main clean target 108 | clean: 109 | $(MAKE) $(MAKESILENT) -f CMakeFiles\Makefile2 clean 110 | .PHONY : clean 111 | 112 | # The main clean target 113 | clean/fast: clean 114 | 115 | .PHONY : clean/fast 116 | 117 | # Prepare targets for installation. 118 | preinstall: all 119 | $(MAKE) $(MAKESILENT) -f CMakeFiles\Makefile2 preinstall 120 | .PHONY : preinstall 121 | 122 | # Prepare targets for installation. 123 | preinstall/fast: 124 | $(MAKE) $(MAKESILENT) -f CMakeFiles\Makefile2 preinstall 125 | .PHONY : preinstall/fast 126 | 127 | # clear depends 128 | depend: 129 | $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles\Makefile.cmake 1 130 | .PHONY : depend 131 | 132 | #============================================================================= 133 | # Target rules for targets named Course_Design_Fifth 134 | 135 | # Build rule for target. 136 | Course_Design_Fifth: cmake_check_build_system 137 | $(MAKE) $(MAKESILENT) -f CMakeFiles\Makefile2 Course_Design_Fifth 138 | .PHONY : Course_Design_Fifth 139 | 140 | # fast build rule for target. 141 | Course_Design_Fifth/fast: 142 | $(MAKE) $(MAKESILENT) -f CMakeFiles\Course_Design_Fifth.dir\build.make CMakeFiles/Course_Design_Fifth.dir/build 143 | .PHONY : Course_Design_Fifth/fast 144 | 145 | main.obj: main.cpp.obj 146 | 147 | .PHONY : main.obj 148 | 149 | # target to build an object file 150 | main.cpp.obj: 151 | $(MAKE) $(MAKESILENT) -f CMakeFiles\Course_Design_Fifth.dir\build.make CMakeFiles/Course_Design_Fifth.dir/main.cpp.obj 152 | .PHONY : main.cpp.obj 153 | 154 | main.i: main.cpp.i 155 | 156 | .PHONY : main.i 157 | 158 | # target to preprocess a source file 159 | main.cpp.i: 160 | $(MAKE) $(MAKESILENT) -f CMakeFiles\Course_Design_Fifth.dir\build.make CMakeFiles/Course_Design_Fifth.dir/main.cpp.i 161 | .PHONY : main.cpp.i 162 | 163 | main.s: main.cpp.s 164 | 165 | .PHONY : main.s 166 | 167 | # target to generate assembly for a file 168 | main.cpp.s: 169 | $(MAKE) $(MAKESILENT) -f CMakeFiles\Course_Design_Fifth.dir\build.make CMakeFiles/Course_Design_Fifth.dir/main.cpp.s 170 | .PHONY : main.cpp.s 171 | 172 | # Help Target 173 | help: 174 | @echo The following are some of the valid targets for this Makefile: 175 | @echo ... all (the default if no target is provided) 176 | @echo ... clean 177 | @echo ... depend 178 | @echo ... edit_cache 179 | @echo ... rebuild_cache 180 | @echo ... Course_Design_Fifth 181 | @echo ... main.obj 182 | @echo ... main.i 183 | @echo ... main.s 184 | .PHONY : help 185 | 186 | 187 | 188 | #============================================================================= 189 | # Special targets to cleanup operation of make. 190 | 191 | # Special rule to run CMake to check the build system integrity. 192 | # No rule that depends on this can have commands that come from listfiles 193 | # because they might be regenerated. 194 | cmake_check_build_system: 195 | $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles\Makefile.cmake 0 196 | .PHONY : cmake_check_build_system 197 | 198 | -------------------------------------------------------------------------------- /Course_Design_Fifth/cmake-build-debug/Manager.txt: -------------------------------------------------------------------------------- 1 | 000 111 222 2 | 123456 000000 Travis 3 | -------------------------------------------------------------------------------- /Course_Design_Fifth/cmake-build-debug/Reader.txt: -------------------------------------------------------------------------------- 1 | 002 000000 Travis_002 2 | 003 000000 tttttt 3 | 001 000000 TravisTravis 4 | -------------------------------------------------------------------------------- /Course_Design_Fifth/cmake-build-debug/ReaderInfoRecord.txt: -------------------------------------------------------------------------------- 1 | 001 Mathbook 6 2 | -------------------------------------------------------------------------------- /Course_Design_Fifth/cmake-build-debug/Testing/Temporary/LastTest.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Travis1024/Course_Code/1e64ed19cd5a0d3c14891cf8eb8d771e5cd13bf8/Course_Design_Fifth/cmake-build-debug/Testing/Temporary/LastTest.log -------------------------------------------------------------------------------- /Course_Design_Fifth/cmake-build-debug/cmake_install.cmake: -------------------------------------------------------------------------------- 1 | # Install script for directory: F:/Clion file/Course_Design_Fifth 2 | 3 | # Set the install prefix 4 | if(NOT DEFINED CMAKE_INSTALL_PREFIX) 5 | set(CMAKE_INSTALL_PREFIX "C:/Program Files (x86)/Course_Design_Fifth") 6 | endif() 7 | string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") 8 | 9 | # Set the install configuration name. 10 | if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME) 11 | if(BUILD_TYPE) 12 | string(REGEX REPLACE "^[^A-Za-z0-9_]+" "" 13 | CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}") 14 | else() 15 | set(CMAKE_INSTALL_CONFIG_NAME "Debug") 16 | endif() 17 | message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"") 18 | endif() 19 | 20 | # Set the component getting installed. 21 | if(NOT CMAKE_INSTALL_COMPONENT) 22 | if(COMPONENT) 23 | message(STATUS "Install component: \"${COMPONENT}\"") 24 | set(CMAKE_INSTALL_COMPONENT "${COMPONENT}") 25 | else() 26 | set(CMAKE_INSTALL_COMPONENT) 27 | endif() 28 | endif() 29 | 30 | # Is this installation the result of a crosscompile? 31 | if(NOT DEFINED CMAKE_CROSSCOMPILING) 32 | set(CMAKE_CROSSCOMPILING "FALSE") 33 | endif() 34 | 35 | if(CMAKE_INSTALL_COMPONENT) 36 | set(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INSTALL_COMPONENT}.txt") 37 | else() 38 | set(CMAKE_INSTALL_MANIFEST "install_manifest.txt") 39 | endif() 40 | 41 | string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT 42 | "${CMAKE_INSTALL_MANIFEST_FILES}") 43 | file(WRITE "F:/Clion file/Course_Design_Fifth/cmake-build-debug/${CMAKE_INSTALL_MANIFEST}" 44 | "${CMAKE_INSTALL_MANIFEST_CONTENT}") 45 | -------------------------------------------------------------------------------- /Course_Design_Fifth/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #define Max 10000 10 | using namespace std; 11 | map p_manager; 12 | map p_reader; 13 | /*----------------书籍信息,读者借阅记录,读者密码,管理员密码类------------------*/ 14 | class BookInfo{ 15 | public: 16 | BookInfo(string book_id,string book_name,int book_total_number,int book_free_number){ 17 | this->book_id=book_id; 18 | this->book_name=book_name; 19 | this->book_total_number=book_total_number; 20 | this->book_free_number=book_free_number; 21 | } 22 | string InputId(); 23 | string InputName(); 24 | int InputTotalNumber(); 25 | int InputFreeNumber(); 26 | protected: 27 | string book_id,book_name; 28 | int book_total_number; 29 | int book_free_number; 30 | }; 31 | class ReaderInfo{ 32 | public: 33 | ReaderInfo(string reader_id,string borrow_book_name,int number_borrowed){ 34 | this->reader_id=reader_id; 35 | this->borrow_book_name=borrow_book_name; 36 | this->number_borrowed=number_borrowed; 37 | } 38 | string InputId(); 39 | string InputBorrowBookName(); 40 | int InputNumberBorrowed(); 41 | protected: 42 | string reader_id; 43 | string borrow_book_name; 44 | int number_borrowed; 45 | }; 46 | class ManagerPassword{ 47 | public: 48 | ManagerPassword(string manager_id,string manager_password,string manager_name){ 49 | this->manager_id=manager_id; 50 | this->manager_password=manager_password; 51 | this->manager_name=manager_name; 52 | } 53 | string InputID(); 54 | string InputPassword(); 55 | string InputName(); 56 | protected: 57 | string manager_id,manager_password,manager_name; 58 | }; 59 | class ReaderPassword{ 60 | public: 61 | ReaderPassword(string reader_id,string reader_password,string reader_name) { 62 | this->reader_id = reader_id; 63 | this->reader_password = reader_password; 64 | this->reader_name=reader_name; 65 | } 66 | string InputID(); 67 | string InputPassword(); 68 | string InputName(); 69 | protected: 70 | string reader_id,reader_password,reader_name; 71 | }; 72 | /*-------------------其他函数---------------------*/ 73 | void UpdataMap(){ 74 | p_manager.clear(); 75 | p_reader.clear(); 76 | ifstream ins_manager("Manager.txt"); 77 | ifstream ins_reader("Reader.txt"); 78 | while (!ins_manager.eof()){ 79 | string id,password,name; 80 | ins_manager>>id>>password>>name; 81 | p_manager.insert(make_pair(id,name)); 82 | } 83 | while (!ins_reader.eof()){ 84 | string id,password,name; 85 | ins_reader>>id>>password>>name; 86 | p_reader.insert(make_pair(id,name)); 87 | } 88 | } 89 | /*------------------书籍信息类功能--------------------*/ 90 | string BookInfo::InputId() { 91 | return book_id; 92 | } 93 | string BookInfo::InputName() { 94 | return book_name; 95 | } 96 | int BookInfo::InputTotalNumber() { 97 | return book_total_number; 98 | } 99 | int BookInfo::InputFreeNumber() { 100 | return book_free_number; 101 | } 102 | /*------------------读者借阅记录类功能--------------------*/ 103 | string ReaderInfo::InputId() { 104 | return reader_id; 105 | } 106 | string ReaderInfo::InputBorrowBookName() { 107 | return borrow_book_name; 108 | } 109 | int ReaderInfo::InputNumberBorrowed() { 110 | return number_borrowed; 111 | } 112 | /*------------------管理员密码类------------------*/ 113 | string ManagerPassword::InputID() { 114 | return manager_id; 115 | } 116 | string ManagerPassword::InputPassword() { 117 | return manager_password; 118 | } 119 | string ManagerPassword::InputName() { 120 | return manager_name; 121 | } 122 | /*------------------读者密码类--------------------*/ 123 | string ReaderPassword::InputID() { 124 | return reader_id; 125 | } 126 | string ReaderPassword::InputPassword() { 127 | return reader_password; 128 | } 129 | string ReaderPassword::InputName() { 130 | return reader_name; 131 | } 132 | /*------------------Common,读者功能,管理员功能类--------------------*/ 133 | class Commonfunction{ 134 | public: 135 | BookInfo *b[Max]; 136 | ReaderInfo *g[Max]; 137 | ManagerPassword *m[Max]; 138 | ReaderPassword *r[Max]; 139 | bool Login_Judge(string,int); 140 | bool ReadData(string,string,int); 141 | void WriteBookInfo(BookInfo *b); 142 | void WriteReaderInfo(ReaderInfo *g); 143 | void WriteReaderPassword(ReaderPassword *r); 144 | bool Update_BookFreeNumber(string,int,int); 145 | bool JudgeRepeat(string); 146 | void Search_BookInfo(); 147 | void Enter_Borrowing_Record(); 148 | void Delete_Borrowing_Record(); 149 | void Alter_ReaderInfo(); 150 | string Deal_Black(string); 151 | void RemoveBlack(string); 152 | }; 153 | class Reader: public Commonfunction{ 154 | public: 155 | void Search_Menu(); 156 | }; 157 | class Manager: public Commonfunction{ 158 | public: 159 | void Search_Menu(); 160 | void Enter_BookInfo(); 161 | void Alter_BookInfo(); 162 | void Delete_BookInfo(); 163 | void Alter_Borrowing_Record(); 164 | void Enter_ReaderInfo(); 165 | void Delete_ReaderInfo(); 166 | void Search_BorrowHistory(); 167 | void Search_ReaderInfo(); 168 | }; 169 | /*-------------------Common类功能----------------------*/ 170 | string Commonfunction::Deal_Black(string name) { 171 | for (int i = 0; i < name.size(); ++i) { 172 | if(name[i]==' ') name[i]='_'; 173 | } 174 | return name; 175 | } 176 | void Commonfunction::RemoveBlack(string file) { 177 | fstream targetFile(file, fstream::in | fstream::out); 178 | string line;//作为读取的每一行 179 | string temp;//作为缓存使用 180 | deque noBlankLineQueue;//双向队列,只在队首和队尾操作时性能较好 181 | //判断文件是否打开 182 | if (!targetFile) { 183 | cerr << "Can't Open File!" << endl; 184 | return; 185 | } 186 | //记录文件开始位置 187 | auto StartPos = targetFile.tellp(); 188 | //循环读取判断文件的空行并放入队列 189 | while (getline(targetFile, line)) { 190 | if (line.empty()) { 191 | } else { 192 | noBlankLineQueue.push_back(line); 193 | } 194 | } 195 | targetFile.close(); 196 | //使用ofstream打开再关闭文件是为了清空源文件 197 | ofstream emptyFile(file); 198 | emptyFile.close(); 199 | //重新打开文本文件 200 | fstream target(file, fstream::out | fstream::in); 201 | if (!target) { 202 | cerr << "Can't Open File" << endl; 203 | } 204 | //获取队首和队尾 205 | auto begin = noBlankLineQueue.begin(); 206 | auto end = noBlankLineQueue.end(); 207 | //遍历双向队列中的元素 208 | //并写回文件 209 | while (begin != end) { 210 | temp = *begin; 211 | target << temp << endl; 212 | ++begin; 213 | } 214 | target.close(); 215 | } 216 | bool Commonfunction::Login_Judge(string id,int identity){ 217 | string password; 218 | cout<<"Please enter your password: "; 219 | cin>>password; 220 | if(ReadData(id,password,identity)) { 221 | cout<<"Login Successful"<> scanid >> scanpassword>>scanname; 248 | if (id == scanid && password == scanpassword) judge = true; 249 | } 250 | return judge; 251 | } 252 | void Commonfunction::WriteBookInfo(BookInfo *b) { 253 | ofstream Gout("BookList.txt", ios::app);//打开顾客文件,追加读写,不会覆盖掉之前的所有信息 254 | Gout << b->InputId() << "\t" << b->InputName() << "\t" << b->InputTotalNumber() << "\t" <InputFreeNumber()<InputId()<<"\t"<InputBorrowBookName()<<"\t"<InputNumberBorrowed()<InputID() << "\t" << r->InputPassword() << "\t" << r->InputName()<> id >> name >> totalnumber >> freenumber; 284 | if(name==book_name){ 285 | if(freenumber> id >>password >>name; 333 | if(id==Inid){ 334 | Rin.close(); 335 | return true; 336 | } 337 | } 338 | Rin.close(); 339 | return false; 340 | } 341 | void Commonfunction::Search_BookInfo() { 342 | string book_id,book_name,book_total_number,book_free_number; 343 | int a=1; 344 | fstream Rin; 345 | ofstream Ron; 346 | Rin.open("BookList.txt", ios::in); 347 | if (!Rin) { 348 | cout << "No file found, please create file first!" << endl; 349 | return; 350 | } 351 | while (!Rin.eof()){ 352 | Rin>>book_id>>book_name>>book_total_number>>book_free_number; 353 | if(book_id!="-1") { 354 | cout<<"Book ID:"<>reader_id; 364 | cout<<"Please enter the name of the book you want to borrow: "; 365 | string str="\n"; 366 | getline(cin,str); 367 | getline(cin,borrow_book_name); 368 | borrow_book_name=Deal_Black(borrow_book_name); 369 | cout<<"Please enter the amount you want to borrow: "; 370 | cin>>number_borrowed; 371 | if(Update_BookFreeNumber(borrow_book_name,2,number_borrowed)){ 372 | WriteReaderInfo(new ReaderInfo(reader_id,borrow_book_name,number_borrowed)); 373 | } 374 | } 375 | void Commonfunction::Delete_Borrowing_Record() { 376 | string targetid,id,name,return_book_name;int xh,a=1,number; 377 | cout<<"Please enter the Reader ID number you want to delete: "; 378 | cin>>targetid; 379 | cout<<"Please enter the name of the book you want to return: "; 380 | string str="\n"; 381 | getline(cin,str); 382 | getline(cin,return_book_name); 383 | return_book_name=Deal_Black(return_book_name); 384 | fstream Rin; 385 | Rin.open("ReaderInfoRecord.txt", ios::in); 386 | if (!Rin) { 387 | cout << "No file found, please create file first!" << endl; 388 | return; 389 | } 390 | while (!Rin.eof()){ 391 | Rin >> id >> name >> number; 392 | if (id==targetid&&name==return_book_name){ 393 | ifstream file("ReaderInfoRecord.txt"); 394 | string line; 395 | int n=a, count = 0; 396 | ofstream outfile("test.txt", ios::out | ios::trunc); 397 | while (!file.eof()) { 398 | getline(file, line); 399 | if (count != n - 1)//如果要修改内容就在这修改line的内容,再存到文件中就行了 400 | outfile << line << endl; 401 | count++; 402 | } 403 | outfile.close(); 404 | file.close(); 405 | ofstream outfile1("ReaderInfoRecord.txt", ios::out | ios::trunc); 406 | fstream file1("test.txt"); 407 | while (!file1.eof()) { 408 | getline(file1, line); 409 | outfile1 << line << endl; 410 | } 411 | outfile1.close(); 412 | file1.close(); 413 | system("del test.txt"); 414 | Update_BookFreeNumber(return_book_name,1,number); 415 | cout<<"Operation is successful!"<>targetid; 427 | fstream Rin; 428 | ofstream Ron; 429 | Rin.open("Reader.txt", ios::in); 430 | if (!Rin) { 431 | cout << "No file found, please create file first!" << endl; 432 | return; 433 | } 434 | while (!Rin.eof()){ 435 | Rin >> id >> password>>name; 436 | if(id==targetid){ 437 | cout<<"ID:"< Change Name"< Change Password"<>xh; 444 | ifstream file("Reader.txt"); 445 | string line; 446 | int n=a,count = 0; 447 | ofstream outfile("test.txt", ios::out | ios::trunc); 448 | while (!file.eof()) { 449 | getline(file, line); 450 | if (count != n - 1) 451 | outfile << line << endl; 452 | count++; 453 | } 454 | outfile.close(); 455 | file.close(); 456 | ofstream outfile1("Reader.txt", ios::out | ios::trunc); 457 | fstream file1("test.txt"); 458 | while (!file1.eof()) { 459 | getline(file1, line); 460 | outfile1 << line << endl; 461 | } 462 | outfile1.close(); 463 | file1.close(); 464 | system("del test.txt"); 465 | Ron.open("Reader.txt", ios::app); 466 | switch (xh) { 467 | case 1:{ 468 | string NewName; 469 | cout<<"Please enter the name you want to change: "; 470 | string str="\n"; 471 | getline(cin,str); 472 | getline(cin,NewName); 473 | NewName=Deal_Black(NewName); 474 | Ron << id << "\t" <>NewPassword; 481 | Ron << id << "\t" << NewPassword << "\t" << name< Borrow Books"< Return Books"< Get the Information of Books"< Modify Personal Information"< Exit"<> n; 509 | switch (n) { 510 | case 1: 511 | Enter_Borrowing_Record();break; 512 | case 2: 513 | Delete_Borrowing_Record();break; 514 | case 3: 515 | Search_BookInfo();break; 516 | case 4: 517 | Alter_ReaderInfo();break; 518 | case 5: 519 | cout << "Thank you for your use, goodbye!" << endl; 520 | exit(0); 521 | default: 522 | cout << "Abnormal input, the system has automatically quit!" << endl; 523 | exit(0); 524 | } 525 | } 526 | } 527 | /*-------------------管理员类功能--------------------*/ 528 | void Manager::Search_Menu() { 529 | while (true) { 530 | cout < Increase Book Information"< Change Book Information"< Delete Book Information"< Increase the Borrowing Record of Readers"< Change the Borrowing Record of Readers"< Delete the Borrowing Record of Readers"< Increase Reader Information"< Change Reader Information"< Delete Reader Information"< Search for Book Information"< Search for Borrowing History"< Search for Reader Information"< Exit"<> n; 546 | switch (n) { 547 | case 1: 548 | Enter_BookInfo();break; 549 | case 2: 550 | Alter_BookInfo();break; 551 | case 3: 552 | Delete_BookInfo();break; 553 | case 4: 554 | Enter_Borrowing_Record();break; 555 | case 5: 556 | Alter_Borrowing_Record();break; 557 | case 6: 558 | Delete_Borrowing_Record();break; 559 | case 7: 560 | Enter_ReaderInfo();break; 561 | case 8: 562 | Alter_ReaderInfo();break; 563 | case 9: 564 | Delete_ReaderInfo();break; 565 | case 10: 566 | Search_BookInfo();break; 567 | case 11: 568 | Search_BorrowHistory();break; 569 | case 12: 570 | Search_ReaderInfo();break; 571 | case 13: 572 | cout << "Thank you for your use, goodbye!" << endl; 573 | exit(0); 574 | default: 575 | cout << "Abnormal input, the system has automatically quit!" << endl; 576 | exit(0); 577 | } 578 | } 579 | } 580 | void Manager::Enter_BookInfo() { 581 | string id,name; 582 | int total_number,free_number; 583 | cout<<"Please enter the book ID number: "; 584 | cin>>id; 585 | cout<<"Please enter the book name: "; 586 | string str="\n"; 587 | getline(cin,str); 588 | getline(cin,name); 589 | name=Deal_Black(name); 590 | cout<<"Please enter the total number of books: "; 591 | cin>>total_number; 592 | cout<<"Please enter the total number of free books: "; 593 | cin>>free_number; 594 | WriteBookInfo(new BookInfo(id,name,total_number,free_number)); 595 | } 596 | void Manager::Alter_BookInfo() { 597 | string targetid,id,name,totalnumber,freenumber;int xh,a=1; 598 | cout<<"Please enter the book ID number you want to modify: "; 599 | cin>>targetid; 600 | fstream Rin; 601 | ofstream Ron; 602 | Rin.open("BookList.txt", ios::in); 603 | if (!Rin) { 604 | cout << "No file found, please create file first!" << endl; 605 | return; 606 | } 607 | while (!Rin.eof()){ 608 | Rin >> id >> name >> totalnumber >> freenumber; 609 | if(id==targetid){ 610 | cout<<"ID:"< Change Name"< Change Total Number"< Change Free Number"<>xh; 618 | ifstream file("BookList.txt"); 619 | string line; 620 | int n=a,count = 0; 621 | ofstream outfile("test.txt", ios::out | ios::trunc); 622 | while (!file.eof()) { 623 | getline(file, line); 624 | if (count != n - 1) 625 | outfile << line << endl; 626 | count++; 627 | } 628 | outfile.close(); 629 | file.close(); 630 | ofstream outfile1("BookList.txt", ios::out | ios::trunc); 631 | fstream file1("test.txt"); 632 | while (!file1.eof()) { 633 | getline(file1, line); 634 | outfile1 << line << endl; 635 | } 636 | outfile1.close(); 637 | file1.close(); 638 | system("del test.txt"); 639 | Ron.open("BookList.txt", ios::app); 640 | switch (xh) { 641 | case 1:{ 642 | string NewName; 643 | cout<<"Please enter the name you want to change: "; 644 | string str="\n"; 645 | getline(cin,str); 646 | getline(cin,NewName); 647 | NewName=Deal_Black(NewName); 648 | Ron << id << "\t" << NewName << "\t" << totalnumber << "\t" << freenumber<>NewNumber; 655 | Ron << id << "\t" << name << "\t" << NewNumber << "\t" << freenumber<>NewNumber; 662 | Ron << id << "\t" << name << "\t" << totalnumber << "\t" << NewNumber<>targetid; 683 | fstream Rin; 684 | Rin.open("BookList.txt", ios::in); 685 | if (!Rin) { 686 | cout << "No file found, please create file first!" << endl; 687 | return; 688 | } 689 | while (!Rin.eof()){ 690 | Rin >> id >> name >> totalnumber >> freenumber; 691 | if (id==targetid){ 692 | ifstream file("BookList.txt"); 693 | string line; 694 | int n=a, count = 0; 695 | ofstream outfile("test.txt", ios::out | ios::trunc); 696 | while (!file.eof()) { 697 | getline(file, line); 698 | if (count != n - 1)//如果要修改内容就在这修改line的内容,再存到文件中就行了 699 | outfile << line << endl; 700 | count++; 701 | } 702 | outfile.close(); 703 | file.close(); 704 | ofstream outfile1("BookList.txt", ios::out | ios::trunc); 705 | fstream file1("test.txt"); 706 | while (!file1.eof()) { 707 | getline(file1, line); 708 | outfile1 << line << endl; 709 | } 710 | outfile1.close(); 711 | file1.close(); 712 | system("del test.txt"); 713 | } 714 | a++; 715 | } 716 | cout<<"Operation is successful!"<>targetid; 724 | cout<<"Please enter the book name you want to modify: "; 725 | string str="\n"; 726 | getline(cin,str); 727 | getline(cin,targetname); 728 | targetname=Deal_Black(targetname); 729 | fstream Rin; 730 | ofstream Ron; 731 | Rin.open("ReaderInfoRecord.txt", ios::in); 732 | if (!Rin) { 733 | cout << "No file found, please create file first!" << endl; 734 | return; 735 | } 736 | while (!Rin.eof()){ 737 | Rin >> id >>book_name>>number; 738 | if(id==targetid&&book_name==targetname){ 739 | cout<<"ID:"< Modify the Amount Borrowed"<>xh; 745 | ifstream file("ReaderInfoRecord.txt"); 746 | string line; 747 | int n=a,count = 0; 748 | ofstream outfile("test.txt", ios::out | ios::trunc); 749 | while (!file.eof()) { 750 | getline(file, line); 751 | if (count != n - 1) 752 | outfile << line << endl; 753 | count++; 754 | } 755 | outfile.close(); 756 | file.close(); 757 | ofstream outfile1("ReaderInfoRecord.txt", ios::out | ios::trunc); 758 | fstream file1("test.txt"); 759 | while (!file1.eof()) { 760 | getline(file1, line); 761 | outfile1 << line << endl; 762 | } 763 | outfile1.close(); 764 | file1.close(); 765 | system("del test.txt"); 766 | Ron.open("ReaderInfoRecord.txt", ios::app); 767 | switch (xh) { 768 | case 1:{ 769 | cout<<"Please enter the number you want to change: "; 770 | cin>>NewNumber; 771 | if(Update_BookFreeNumber(book_name,2,NewNumber-number)){ 772 | Ron << id << "\t" << book_name << "\t" << NewNumber<>id; 794 | if(JudgeRepeat(id)){ 795 | cout<<"The current ID already exists!"<>password; 800 | cout<<"Please enter the reader name: "; 801 | string str="\n"; 802 | getline(cin,str); 803 | getline(cin,name); 804 | name=Deal_Black(name); 805 | WriteReaderPassword(new ReaderPassword(id,password,name)); 806 | UpdataMap(); 807 | } 808 | void Manager::Delete_ReaderInfo() { 809 | string targetid,id,name,password;int xh,a=1; 810 | cout<<"Please enter the reader ID number you want to delete: "; 811 | cin>>targetid; 812 | fstream Rin; 813 | Rin.open("Reader.txt", ios::in); 814 | if (!Rin) { 815 | cout << "No file found, please create file first!" << endl; 816 | return; 817 | } 818 | while (!Rin.eof()){ 819 | Rin >> id >>password >>name; 820 | if (id==targetid){ 821 | ifstream file("Reader.txt"); 822 | string line; 823 | int n=a, count = 0; 824 | ofstream outfile("test.txt", ios::out | ios::trunc); 825 | while (!file.eof()) { 826 | getline(file, line); 827 | if (count != n - 1)//如果要修改内容就在这修改line的内容,再存到文件中就行了 828 | outfile << line << endl; 829 | count++; 830 | } 831 | outfile.close(); 832 | file.close(); 833 | ofstream outfile1("Reader.txt", ios::out | ios::trunc); 834 | fstream file1("test.txt"); 835 | while (!file1.eof()) { 836 | getline(file1, line); 837 | outfile1 << line << endl; 838 | } 839 | outfile1.close(); 840 | file1.close(); 841 | system("del test.txt"); 842 | } 843 | a++; 844 | } 845 | cout<<"Operation is successful!"<>id>>book_name>>number; 862 | if(id!="-1"){ 863 | cout<<"Reader ID:"<>reader_id>>reader_password>>reader_name; 880 | if(reader_id!="-1") { 881 | cout<<"Reader ID:"<>a>>b; 906 | if(a=="-a"){ 907 | Manager manager; 908 | if(manager.Login_Judge(b,1)){ 909 | manager.Search_Menu(); 910 | } 911 | } else if (a=="-u"){ 912 | Reader reader; 913 | if(reader.Login_Judge(b,2)){ 914 | reader.Search_Menu(); 915 | } 916 | } 917 | return 0; 918 | } 919 | -------------------------------------------------------------------------------- /IOT_Experiment/ACL配置实验报告.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Travis1024/Course_Code/1e64ed19cd5a0d3c14891cf8eb8d771e5cd13bf8/IOT_Experiment/ACL配置实验报告.pdf -------------------------------------------------------------------------------- /IOT_Experiment/DES实验报告.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Travis1024/Course_Code/1e64ed19cd5a0d3c14891cf8eb8d771e5cd13bf8/IOT_Experiment/DES实验报告.pdf -------------------------------------------------------------------------------- /IOT_Experiment/Geth搭建ETH实验报告.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Travis1024/Course_Code/1e64ed19cd5a0d3c14891cf8eb8d771e5cd13bf8/IOT_Experiment/Geth搭建ETH实验报告.pdf -------------------------------------------------------------------------------- /IOT_Experiment/MD5算法实验报告.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Travis1024/Course_Code/1e64ed19cd5a0d3c14891cf8eb8d771e5cd13bf8/IOT_Experiment/MD5算法实验报告.pdf -------------------------------------------------------------------------------- /IOT_Experiment/凯撒密码实验报告.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Travis1024/Course_Code/1e64ed19cd5a0d3c14891cf8eb8d771e5cd13bf8/IOT_Experiment/凯撒密码实验报告.pdf -------------------------------------------------------------------------------- /IOT_Experiment/椭圆曲线算法实验报告.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Travis1024/Course_Code/1e64ed19cd5a0d3c14891cf8eb8d771e5cd13bf8/IOT_Experiment/椭圆曲线算法实验报告.pdf -------------------------------------------------------------------------------- /IOT_Experiment/源代码/DES.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | using namespace std; 4 | /*---------------------------变换表初始化-----------------------------*/ 5 | //---S盒,8组6bit 6 | int S_Box[8][4][16]={ 7 | { 8 | {14,4,13,1,2,15,11,8,3,10,6,12,5,9,0,7}, 9 | {0,15,7,4,14,2,13,1,10,6,12,11,9,5,3,8}, 10 | {4,1,14,8,13,6,2,11,15,12,9,7,3,10,5,0}, 11 | {15,12,8,2,4,9,1,7,5,11,3,14,10,0,6,13} 12 | }, 13 | { 14 | {15,1,8,14,6,11,3,4,9,7,2,13,12,0,5,10}, 15 | {3,13,4,7,15,2,8,14,12,0,1,10,6,9,11,5}, 16 | {0,14,7,11,10,4,13,1,5,8,12,6,9,3,2,15}, 17 | {13,8,10,1,3,15,4,2,11,6,7,12,0,5,14,9} 18 | }, 19 | { 20 | {10,0,9,14,6,3,15,5,1,13,12,7,11,4,2,8}, 21 | {13,7,0,9,3,4,6,10,2,8,5,14,12,11,15,1}, 22 | {13,6,4,9,8,15,3,0,11,1,2,12,5,10,14,7}, 23 | {1,10,13,0,6,9,8,7,4,15,14,3,11,5,2,12} 24 | }, 25 | { 26 | {7,13,14,3,0,6,9,10,1,2,8,5,11,12,4,15}, 27 | {13,8,11,5,6,15,0,3,4,7,2,12,1,10,14,9}, 28 | {10,6,9,0,12,11,7,13,15,1,3,14,5,2,8,4}, 29 | {3,15,0,6,10,1,13,8,9,4,5,11,12,7,2,14} 30 | }, 31 | { 32 | {2,12,4,1,7,10,11,6,8,5,3,15,13,0,14,9}, 33 | {14,11,2,12,4,7,13,1,5,0,15,10,3,9,8,6}, 34 | {4,2,1,11,10,13,7,8,15,9,12,5,6,3,0,14}, 35 | {11,8,12,7,1,14,2,13,6,15,0,9,10,4,5,3} 36 | }, 37 | { 38 | {12,1,10,15,9,2,6,8,0,13,3,4,14,7,5,11}, 39 | {10,15,4,2,7,12,9,5,6,1,13,14,0,11,3,8}, 40 | {9,14,15,5,2,8,12,3,7,0,4,10,1,13,11,6}, 41 | {4,3,2,12,9,5,15,10,11,14,1,7,6,0,8,13} 42 | }, 43 | { 44 | {4,11,2,14,15,0,8,13,3,12,9,7,5,10,6,1}, 45 | {13,0,11,7,4,9,1,10,14,3,5,12,2,15,8,6}, 46 | {1,4,11,13,12,3,7,14,10,15,6,8,0,5,9,2}, 47 | {6,11,13,8,1,4,10,7,9,5,0,15,14,2,3,12} 48 | }, 49 | { 50 | {13,2,8,4,6,15,11,1,10,9,3,14,5,0,12,7}, 51 | {1,15,13,8,10,3,7,4,12,5,6,11,0,14,9,2}, 52 | {7,11,4,1,9,12,14,2,0,6,10,13,15,3,5,8}, 53 | {2,1,14,7,4,10,8,13,15,12,9,0,3,5,6,11} 54 | } 55 | }; 56 | //E扩展,拓展每个Rn-1,将其从32位拓展到48位,通过此表来重复实现 57 | int E_Table[48]={ 58 | 32,1,2,3,4,5,4,5,6,7,8,9, 59 | 8,9, 10, 11,12,13,12,13,14,15,16,17, 60 | 16,17,18,19,20,21,20,21,22,23,24,25, 61 | 24,25,26,27,28,29,28,29,30,31,32,1 62 | }; 63 | //对于明文数据M,通过IP进行重新变换 64 | int IP[8][8]={ 65 | {58,50,42,34,26,18,10,2}, 66 | {60,52,44,36,28,20,12,4}, 67 | {62,54,46,38,30,22,14,6}, 68 | {64,56,48,40,32,24,16,8}, 69 | {57,49,41,33,25,17,9, 1}, 70 | {59,51,43,35,27,19,11,3}, 71 | {61,53,45,37,29,21,13,5}, 72 | {63,55,47,39,31,23,15,7} 73 | }; 74 | //密文逆置换 75 | int IP_Inverse[8][8]={ 76 | {40,8,48,16,56,24,64,32}, 77 | {39,7,47,15,55,23,63,31}, 78 | {38,6,46,14,54,22,62,30}, 79 | {37,5,45,13,53,21,61,29}, 80 | {36,4,44,12,52,20,60,28}, 81 | {35,3,43,11,51,19,59,27}, 82 | {34,2,42,10,50,18,58,26}, 83 | {33,1,41, 9,49,17,57,25} 84 | }; 85 | //64->56选择,得到k+,分割为C\D 86 | int PC_1[8][7]={ 87 | {57,49,41,33,25,17, 9}, 88 | {1,58,50, 42,34,26,18}, 89 | {10, 2,59,51,43,35,27}, 90 | {19,11, 3,60,52,44,36}, 91 | {63,55,47,39,31,23,15}, 92 | {7,62,54, 46,38,30,22}, 93 | {14, 6,61,53,45,37,29}, 94 | {21,13, 5,28,20,12, 4} 95 | }; 96 | //秘钥置换,56->48,使得CD组合变为新密钥Kn 97 | int PC_2[8][6]={ 98 | {14,17,11,24,1,5}, 99 | {3,28,15,6,21,10}, 100 | {23,19,12,4,26,8}, 101 | {16,7,27,20,13,2}, 102 | {41,52,31,37,47,55}, 103 | {30,40,51,45,33,48}, 104 | {44,49,39,56,34,53}, 105 | {46,42,50,36,29,32} 106 | }; 107 | //P置换及左移操作 108 | int P[32] = {16,7,20,21,29,12,28,17,1,15,23,26,5,18,31,10,2,8,24,14,32,27,3,9,19,13,30,6,22,11,4,25}; 109 | int Left_Shift[16]={1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1}; 110 | 111 | /*------------------------------全局参数声明------------------------------------*/ 112 | int L[32]={0},R[32]={0},C[28]={0},D[28]={0}; 113 | int SubKey_ByPC2[16][48]={0}; 114 | 115 | /*--------------------------------函数部分--------------------------------------*/ 116 | //十六进制字符串,转换成二进制数组 117 | int** HexToBinary(string original){ 118 | int x[original.size()],middle_data[4*original.size()],num=0; 119 | int** result=new int*[8]; 120 | for (int i = 0; i < 8; ++i) 121 | *(result+i)=new int[8]; 122 | for (int i = 0; i < original.size(); ++i) { 123 | if(original[i]>'F'&&original[i]<='Z') original[i]='F'; 124 | else if(original[i]>'f'&&original[i]<='z') original[i]='f'; 125 | if(original[i]>='0'&&original[i]<='9'){ 126 | x[i]=original[i]-48; //0的ASCLL为48 127 | }else if(original[i]>='A'&&original[i]<='F'){ 128 | x[i]=original[i]-55; //A的ASCLL为65,减10 129 | }else if(original[i]>='a'&&original[i]<='f'){ 130 | x[i]=original[i]-87; //a的ASCLL为97,减10 131 | } 132 | middle_data[4*i] = x[i] / 8; 133 | middle_data[4*i+1] = (x[i] - middle_data[4*i] * 8) / 4; 134 | middle_data[4*i+2] = (x[i] - middle_data[4*i] * 8 - middle_data[4*i+1] * 4) / 2; 135 | middle_data[4*i+3] = x[i] - middle_data[4*i] * 8 - middle_data[4*i+1] * 4 - middle_data[4*i+2] * 2; 136 | } 137 | for (int i = 0; i < 8; ++i) 138 | for (int j = 0; j < 8; ++j) 139 | result[i][j]= middle_data[num++]; 140 | return result; 141 | } 142 | //-------二进制转化成十六进制 143 | string BinaryToHex(int a[]){ 144 | string result; 145 | result.resize(16); 146 | for (int i = 0,j=0; i < 64; i+=4,++j) { 147 | int sum=a[i] * 8 + a[i + 1] * 4 + a[i + 2] * 2 + a[i + 3]; 148 | if(sum<10) result[j]=sum+'0'; 149 | else if(sum==10) result[j]='A'; 150 | else if(sum==11) result[j]='B'; 151 | else if(sum==12) result[j]='C'; 152 | else if(sum==13) result[j]='D'; 153 | else if(sum==14) result[j]='E'; 154 | else if(sum==15) result[j]='F'; 155 | } 156 | return result; 157 | } 158 | 159 | //通过PC-1变换产生第一轮秘钥(64位密钥->56位),同时生成C0/D0 160 | int** Create_SubKey(int** key){ 161 | int** SubKey=new int*[8]; 162 | for (int i = 0; i < 8; ++i) 163 | *(SubKey+i)=new int[7]; 164 | int middle_data[64],num=0,C_num=0,D_num=0; 165 | for (int i = 0; i < 8; ++i) 166 | for (int j = 0; j < 8; ++j) 167 | middle_data[num++]=key[i][j]; 168 | for (int i = 0; i < 8; ++i) { 169 | for (int j = 0; j < 7; ++j) { 170 | SubKey[i][j]=middle_data[PC_1[i][j] - 1]; 171 | if(C_num<28) C[C_num++]=SubKey[i][j]; //56位分为28+28,分别存到C/D中 172 | else D[D_num++]=SubKey[i][j]; 173 | } 174 | } 175 | return SubKey; 176 | } 177 | 178 | //循环产生子密钥,C1-C16,D1-D16,由C0、D0推导 179 | void Cycle_SubKey(int n){ 180 | int times=Left_Shift[n],C0,D0; 181 | for (int i = 0; i < times; ++i) { 182 | C0=C[0]; 183 | D0=D[0]; 184 | for (int j = 0; j < 28; ++j) { 185 | C[j - 1] = C[j]; 186 | D[j - 1] = D[j]; 187 | } 188 | C[27] = C0; 189 | D[27] = D0; 190 | } 191 | } 192 | //通过PC-2,使56位子密钥变为48位,并记录 193 | void TurnInto_NewKey(int n){ 194 | int** NewSubKey=new int*[8]; 195 | for (int i = 0; i < 8; ++i) 196 | *(NewSubKey+i)=new int[6]; 197 | int NowCD[56],NewKey[48],num=0; 198 | for (int i = 0; i < 56; ++i) { 199 | if(i<28) NowCD[i]=C[i]; 200 | else NowCD[i]=D[i-28]; 201 | } 202 | for (int i = 0; i < 8; ++i) { 203 | for (int j = 0; j < 6; ++j) { 204 | NewKey[num++]=NowCD[PC_2[i][j]-1]; 205 | SubKey_ByPC2[15-n][num-1]=NewKey[num-1]; 206 | } 207 | } 208 | } 209 | //通过IP变换初始化L,R 210 | void IP_Transform(int** original){ 211 | int ori_data[64],num=0,middle_data[64]; 212 | for (int i = 0; i < 8; ++i) 213 | for (int j = 0; j < 8; ++j) 214 | ori_data[num++]=original[i][j]; 215 | for (int i = 0; i < 8; ++i) { 216 | for (int j = 0; j < 8; ++j) { 217 | middle_data[8*i+j]=ori_data[IP[i][j]-1]; 218 | if(8*i+j<32) L[8*i+j]=middle_data[8*i+j]; 219 | else R[8*i+j-32]=middle_data[8*i+j]; 220 | } 221 | } 222 | } 223 | /*为了计算F,我们首先拓展每个Rn-1,将其从32位拓展到48位。这是通过使用表E 224 | * 来重复Rn-1中的一些位来实现。也就是说函数E(Rn-1)输入32位输出48位。*/ 225 | int* F(int n,int flag){ 226 | int *result=new int[32],** B=new int*[8]; 227 | for (int i = 0; i < 8; ++i) 228 | *(B+i)=new int[6]; 229 | int middle_ER[48],NowK[48],a[48],first,second,middle_all_s[8],result_s[32]; 230 | for (int i = 0; i < 48; ++i) { 231 | middle_ER[i]=R[E_Table[i]-1]; //使用表E扩展位数 232 | NowK[i]=SubKey_ByPC2[16-n][i]; //取原先记录的子密钥 233 | } 234 | //逆变换,为了实现解密过程准备 235 | if(flag==1){ 236 | for (int i = 0; i < 48; ++i) { 237 | NowK[i]=SubKey_ByPC2[n-1][i]; 238 | } 239 | } 240 | for (int i = 0; i < 48; ++i) 241 | a[i]=(NowK[i]+middle_ER[i])%2; //进行XOR运算 242 | for (int i = 0; i < 8; ++i) 243 | for (int j = 0; j < 6; ++j) //将8组6比特数据记录在B中 244 | B[i][j]=a[6*i+j]; 245 | /*B的第一位和最后一位组合起来的二进制数决定一个介于0和3之间的十进制数(或者二进制00到11之间)。 246 | * 设这个数为i。B的中间4位二进制数代表一个介于0到15之间的十进制数(二进制0000到1111)。 247 | * 设这个数为j。查表找到第i行第j列的那个数*/ 248 | for (int i = 0; i < 8; ++i) { 249 | first=B[i][0]*2+B[i][5]; //将8组数据输入S函数 250 | second=B[i][1] * 8 + B[i][2] * 4 + B[i][3] * 2 + B[i][4]; 251 | middle_all_s[i]=S_Box[i][first][second]; 252 | } 253 | for (int i = 0; i < 8; ++i) { 254 | result_s[i*4]=middle_all_s[i]/8; 255 | result_s[i*4+1]=(middle_all_s[i]-result_s[i*4]*8)/4; 256 | result_s[i*4+2]=(middle_all_s[i]-result_s[i*4]*8-result_s[i*4+1]*4)/2; 257 | result_s[i*4+3]=middle_all_s[i]-result_s[i*4]*8-result_s[i*4+1]*4-result_s[i*4+2]*2; 258 | } 259 | //对S盒的输出转换成二进制之后,进行P变换,得到32位数据 260 | for (int i = 0; i < 32; ++i) 261 | result[i]=result_s[P[i]-1]; 262 | return result; 263 | } 264 | /*通次此函数进行16次迭代后得到L1-L16,R1-R16 265 | * Ln = Rn-1 ;Rn = Ln-1 + F(Rn-1,Kn);*/ 266 | void Update_LR(int n,int flag){ 267 | int middle_L[32],middle_R[32]; 268 | for (int i = 0; i < 32; ++i) { 269 | middle_L[i]=L[i]; 270 | middle_R[i]=R[i]; 271 | } 272 | int* result=new int[32]; 273 | //在F函数中实现F(Rn-1,Kn) 274 | result=F(n,flag); 275 | for (int i = 0; i < 32; ++i) { 276 | L[i]=middle_R[i]; 277 | R[i]=(result[i]+middle_L[i])%2; 278 | } 279 | /*在第16个迭代之后,我们有了区块L16 and R16。 280 | * 接着我们逆转两个区块的顺序得到一个64位的区块*/ 281 | if(n==16){ 282 | for (int i = 0; i < 32; i++) { 283 | int temp = L[i]; 284 | L[i] = R[i]; 285 | R[i] = temp; 286 | } 287 | } 288 | } 289 | 290 | //实现DES的解密过程,只是中间存在一步子密钥顺序的调换,其他相同 291 | void Decode(string original){ 292 | int** middle=new int*[8]; 293 | int result[64],Combine_LR[64]; 294 | for (int i = 0; i < 8; ++i) 295 | middle[i]=new int[8]; 296 | middle=HexToBinary(original); 297 | IP_Transform(middle); 298 | for (int i = 1; i <= 16; ++i) { 299 | Update_LR(i,1); 300 | } 301 | for (int j = 0; j < 64; ++j) { 302 | if(j<32) Combine_LR[j]=L[j]; 303 | else Combine_LR[j]=R[j-32]; 304 | } 305 | for (int j = 0; j < 8; ++j) { 306 | for (int k = 0; k < 8; ++k) { 307 | result[j*8+k]=Combine_LR[IP_Inverse[j][k]-1]; 308 | } 309 | } 310 | string Final_result=BinaryToHex(result); 311 | cout<<"Decryption result: "< 2 | #include 3 | #include 4 | #include 5 | #include 6 | typedef struct point { 7 | int point_x; 8 | int point_y; 9 | } Point; 10 | typedef struct ecc { 11 | struct point p[100]; 12 | int len; 13 | } ECCPoint; 14 | typedef struct generator { 15 | Point p; 16 | int p_class; 17 | } Generetor_Create; 18 | 19 | Point P1, P2, Pt, G, PB, Pm; 20 | ECCPoint eccPoint; 21 | Generetor_Create generetor_create[100]; 22 | 23 | int a = 4, b = 20, p = 29, geneLen, nB; //nB为私钥 24 | int m[100], C[100]; 25 | char text[] = "xidian university"; 26 | char alphabet[27] = "abcdefghijklmnopqrstuvwxyz"; 27 | 28 | Point point(int k, Point p); 29 | Point add_pairpoints(Point p1, Point p2); 30 | void Get_Points(); 31 | void Print_Points(); 32 | int Sqrt(int s); 33 | int Solve_InversaElement(int n, int b); 34 | int P_Mod(int s); 35 | int Judge_Prime(int n); 36 | 37 | //加密 38 | void Encrypt() { 39 | int num, i, j, gene_class, num_t, k; 40 | srand(time(NULL)); 41 | //明文转换过程 42 | for (i = 0; i < strlen(text); i++) { 43 | for (j = 0; j < 26; j++) { 44 | if (text[i] == alphabet[j]) { 45 | m[i] = j;//将字符串明文换成数字,并存到整型数组m里面 46 | } 47 | } 48 | } 49 | //选择生成元 50 | num = rand() % geneLen; 51 | gene_class = generetor_create[num].p_class; 52 | while (Judge_Prime(gene_class) == -1) {//不是素数 53 | num = rand() % (geneLen - 3) + 3; 54 | gene_class = generetor_create[num].p_class; 55 | } 56 | G = generetor_create[num].p; 57 | nB = rand() % (gene_class - 1) + 1;//选择私钥 58 | PB = point(nB, G); 59 | printf("\nPublic key: "); 60 | printf(" | Order: %d | G: (%d,%d) | (%d,%d)\n", a, b, gene_class, G.point_x, G.point_y, PB.point_x, PB.point_y); 61 | printf("Private key: %d\n",nB); 62 | //加密 63 | k = rand() % (gene_class - 2) + 1; 64 | P1 = point(k, G); 65 | num_t = rand() % eccPoint.len; //选择映射点 66 | Pt = eccPoint.p[num_t]; 67 | P2 = point(k, PB); 68 | Pm = add_pairpoints(Pt, P2); 69 | printf("Enciphered data:\n"); 70 | printf("kG=(%d,%d) | Pt+kPB=(%d,%d) | C= ", P1.point_x, P1.point_y, Pm.point_x, Pm.point_y); 71 | for (i = 0; i < strlen(text); i++) { 72 | C[i] = m[i] * Pt.point_x + Pt.point_y; 73 | printf("<%d>", C[i]); 74 | } 75 | printf(" \n"); 76 | } 77 | 78 | //解密 79 | void Decrypt() { 80 | Point temp, temp1; 81 | int m, i; 82 | temp = point(nB, P1); 83 | temp.point_y = 0 - temp.point_y; 84 | temp1 = add_pairpoints(Pm, temp);//求解Pt 85 | printf("\nDecryption result:\n"); 86 | for (i = 0; i < strlen(text); i++) { 87 | m = (C[i] - temp1.point_y) / temp1.point_x; 88 | printf("%c", alphabet[m]);//输出密文 89 | } 90 | printf("\n"); 91 | } 92 | 93 | //判断是否为素数 94 | int Judge_Prime(int n) { 95 | int i, k; 96 | k = sqrt(n); 97 | for (i = 2; i <= k; i++) 98 | if (n % i == 0) break; 99 | if (i <= k) return -1; 100 | else return 0; 101 | } 102 | 103 | //求生成元以及阶 104 | void Get_Generetor() { 105 | int i, j = 0; 106 | int count = 1; 107 | Point p1, p2; 108 | Get_Points(); 109 | printf("\n\n"); 110 | for (i = 0; i < eccPoint.len; i++) { 111 | count = 1; 112 | p1.point_x = p2.point_x = eccPoint.p[i].point_x; 113 | p1.point_y = p2.point_y = eccPoint.p[i].point_y; 114 | while (1) { 115 | p2 = add_pairpoints(p1, p2); 116 | if (p2.point_x == -1 && p2.point_y == -1) 117 | break; 118 | count++; 119 | if (p2.point_x == p1.point_x) { 120 | break; 121 | } 122 | } 123 | count++; 124 | if (count <= eccPoint.len + 1) { 125 | generetor_create[j].p.point_x = p1.point_x; 126 | generetor_create[j].p.point_y = p1.point_y; 127 | generetor_create[j].p_class = count; 128 | printf("(%d,%d)-[%d]\t",generetor_create[j].p.point_x,generetor_create[j].p.point_y,generetor_create[j].p_class); 129 | j++; 130 | if(j % 6 == 0) printf("\n"); 131 | } 132 | geneLen = j; 133 | } 134 | } 135 | 136 | //t倍点运算的递归算法 137 | Point point(int k, Point p0) { 138 | if (k == 1) return p0; 139 | else if (k == 2) return add_pairpoints(p0, p0); 140 | else return add_pairpoints(p0, point(k - 1, p0)); 141 | } 142 | 143 | //两点的加法运算 144 | Point add_pairpoints(Point p1, Point p2) { 145 | long t; 146 | int x1 = p1.point_x, y1 = p1.point_y; 147 | int x2 = p2.point_x, y2 = p2.point_y; 148 | int tx, ty, x3, y3, flag = 0; 149 | //求 150 | if ((x2 == x1) && (y2 == y1)) { 151 | //相同点相加 152 | if (y1 == 0) flag = 1; 153 | else t = (3 * x1 * x1 + a) * Solve_InversaElement(p, 2 * y1) % p; 154 | } else { 155 | //不同点相加 156 | ty = y2 - y1; 157 | tx = x2 - x1; 158 | while (ty < 0) 159 | ty += p; 160 | while (tx < 0) 161 | tx += p; 162 | if (tx == 0 && ty != 0) flag = 1; 163 | else t = ty * Solve_InversaElement(p, tx) % p; 164 | } 165 | if (flag == 1) { 166 | p2.point_x = -1; 167 | p2.point_y = -1; 168 | } else { 169 | x3 = (t * t - x1 - x2) % p; 170 | y3 = (t * (x1 - x3) - y1) % p; 171 | //使结果在有限域GF(P)上 172 | while (x3 < 0) 173 | x3 += p; 174 | while (y3 < 0) 175 | y3 += p; 176 | p2.point_x = x3; 177 | p2.point_y = y3; 178 | } 179 | return p2; 180 | } 181 | 182 | //求b关于n的逆元 183 | int Solve_InversaElement(int n, int b) { 184 | int q, r, r1 = n, r2 = b, t, t1 = 0, t2 = 1, i = 1; 185 | while (r2 > 0) { 186 | q = r1 / r2; 187 | r = r1 % r2; 188 | r1 = r2; 189 | r2 = r; 190 | t = t1 - q * t2; 191 | t1 = t2; 192 | t2 = t; 193 | } 194 | if (t1 >= 0) 195 | return t1 % n; 196 | else { 197 | while ((t1 + i * n) < 0) 198 | i++; 199 | return t1 + i * n; 200 | } 201 | } 202 | 203 | //求出椭圆曲线上所有点 204 | void Get_Points() { 205 | int i = 0, j = 0, s, y = 0, n = 0, q = 0; 206 | int modsqrt = 0, flag = 0; 207 | if (4 * a * a * a + 27 * b * b != 0) { 208 | for (i = 0; i <= p - 1; i++) { 209 | flag = 0; 210 | n = 1; 211 | y = 0; 212 | s = i * i * i + a * i + b; 213 | while (s < 0) { 214 | s += p; 215 | } 216 | s = P_Mod(s); 217 | modsqrt = Sqrt(s); 218 | if (modsqrt != -1) { 219 | flag = 1; 220 | y = modsqrt; 221 | } else { 222 | while (n <= p - 1) { 223 | q = s + n * p; 224 | modsqrt = Sqrt(q); 225 | if (modsqrt != -1) { 226 | y = modsqrt; 227 | flag = 1; 228 | break; 229 | } 230 | flag = 0; 231 | n++; 232 | } 233 | } 234 | if (flag == 1) { 235 | eccPoint.p[j].point_x = i; 236 | eccPoint.p[j].point_y = y; 237 | j++; 238 | if (y != 0) { 239 | eccPoint.p[j].point_x = i; 240 | eccPoint.p[j].point_y = (p - y) % p; 241 | j++; 242 | } 243 | } 244 | } 245 | eccPoint.len = j;//点集个数 246 | Print_Points(); //打印点集 247 | } 248 | } 249 | 250 | //取模函数 251 | int P_Mod(int s) { 252 | int i,result; //i保存s/p的倍数,result保存模运算的结果 253 | i = s / p; 254 | result = s - i * p; 255 | if (result >= 0) return result; 256 | else return result + p; 257 | } 258 | 259 | //判断平方根是否为整数 260 | int Sqrt(int s) { 261 | int temp; 262 | temp = (int) sqrt(s);//转为整型 263 | if (temp * temp == s) return temp; 264 | else return -1; 265 | } 266 | 267 | //打印点集 268 | void Print_Points() { 269 | int i, len = eccPoint.len; 270 | printf("--------------------------------------ECC------------------------------------------"); 271 | printf("\nThere are a total of %d points on the elliptic curve. (including infinity points)", len + 1); 272 | for (i = 0; i < len; i++) { 273 | if (i % 8 == 0) { 274 | printf("\n"); 275 | } 276 | printf("(%2d,%2d)\t", eccPoint.p[i].point_x, eccPoint.p[i].point_y); 277 | } 278 | printf("\n"); 279 | } -------------------------------------------------------------------------------- /IOT_Experiment/源代码/IOT_md5.java: -------------------------------------------------------------------------------- 1 | class MD5{ 2 | //初始化MD5参数 3 | static final int S11 = 7; 4 | static final int S12 = 12; 5 | static final int S13 = 17; 6 | static final int S14 = 22; 7 | static final int S21 = 5; 8 | static final int S22 = 9; 9 | static final int S23 = 14; 10 | static final int S24 = 20; 11 | static final int S31 = 4; 12 | static final int S32 = 11; 13 | static final int S33 = 16; 14 | static final int S34 = 23; 15 | static final int S41 = 6; 16 | static final int S42 = 10; 17 | static final int S43 = 15; 18 | static final int S44 = 21; 19 | //定义标准幻数 20 | private static final long A=0x67452301L; 21 | private static final long B=0xefcdab89L; 22 | private static final long C=0x98badcfeL; 23 | private static final long D=0x10325476L; 24 | 25 | private long [] result={A,B,C,D}; //存储结果 26 | static final String hexs[]={"0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"}; 27 | private String str; 28 | 29 | public MD5(String str) { 30 | this.str=str; 31 | String result=Main_process(); 32 | System.out.println("| MD5---<"+str+">"+" | \nResult: "+result); 33 | } 34 | 35 | private String Main_process() { 36 | byte [] inputBytes=str.getBytes(); 37 | int str_length=inputBytes.length; //字符串字节长度 38 | int group_number=0; //分组个数,每组512位(64字节) 39 | group_number=str_length/64; //字节长度/64字节 40 | long []groups=null; //每组按4字节继续细分 41 | 42 | for(int i=0;i>8; 61 | } 62 | groups=Create_NewGroup(tempBytes,0); 63 | Transform(groups); 64 | }else{ 65 | for(int i=0;i>8; 79 | } 80 | groups=Create_NewGroup(tempBytes,0); 81 | Transform(groups); 82 | } 83 | return ToHexString(); 84 | } 85 | 86 | private String ToHexString(){ //Hash值转换成十六进制的字符串 87 | String resStr=""; 88 | long temp=0; 89 | for(int i=0;i<4;i++){ 90 | for(int j=0;j<4;j++){ 91 | temp=result[i]&0x0FL; 92 | String a=hexs[(int)(temp)]; 93 | result[i]=result[i]>>4; 94 | temp=result[i]&0x0FL; 95 | resStr+=hexs[(int)(temp)]+a; 96 | result[i]=result[i]>>4; 97 | } 98 | } 99 | return resStr; 100 | } 101 | private void Transform(long[] groups) { //对分组进行处理,每个分组64字节 102 | long a = result[0], b = result[1], c = result[2], d = result[3]; 103 | //第一轮 104 | a = FF(a, b, c, d, groups[0], S11, 0xd76aa478L); 105 | d = FF(d, a, b, c, groups[1], S12, 0xe8c7b756L); 106 | c = FF(c, d, a, b, groups[2], S13, 0x242070dbL); 107 | b = FF(b, c, d, a, groups[3], S14, 0xc1bdceeeL); 108 | a = FF(a, b, c, d, groups[4], S11, 0xf57c0fafL); 109 | d = FF(d, a, b, c, groups[5], S12, 0x4787c62aL); 110 | c = FF(c, d, a, b, groups[6], S13, 0xa8304613L); 111 | b = FF(b, c, d, a, groups[7], S14, 0xfd469501L); 112 | a = FF(a, b, c, d, groups[8], S11, 0x698098d8L); 113 | d = FF(d, a, b, c, groups[9], S12, 0x8b44f7afL); 114 | c = FF(c, d, a, b, groups[10], S13, 0xffff5bb1L); 115 | b = FF(b, c, d, a, groups[11], S14, 0x895cd7beL); 116 | a = FF(a, b, c, d, groups[12], S11, 0x6b901122L); 117 | d = FF(d, a, b, c, groups[13], S12, 0xfd987193L); 118 | c = FF(c, d, a, b, groups[14], S13, 0xa679438eL); 119 | b = FF(b, c, d, a, groups[15], S14, 0x49b40821L); 120 | //第二轮 121 | a = GG(a, b, c, d, groups[1], S21, 0xf61e2562L); 122 | d = GG(d, a, b, c, groups[6], S22, 0xc040b340L); 123 | c = GG(c, d, a, b, groups[11], S23, 0x265e5a51L); 124 | b = GG(b, c, d, a, groups[0], S24, 0xe9b6c7aaL); 125 | a = GG(a, b, c, d, groups[5], S21, 0xd62f105dL); 126 | d = GG(d, a, b, c, groups[10], S22, 0x2441453L); 127 | c = GG(c, d, a, b, groups[15], S23, 0xd8a1e681L); 128 | b = GG(b, c, d, a, groups[4], S24, 0xe7d3fbc8L); 129 | a = GG(a, b, c, d, groups[9], S21, 0x21e1cde6L); 130 | d = GG(d, a, b, c, groups[14], S22, 0xc33707d6L); 131 | c = GG(c, d, a, b, groups[3], S23, 0xf4d50d87L); 132 | b = GG(b, c, d, a, groups[8], S24, 0x455a14edL); 133 | a = GG(a, b, c, d, groups[13], S21, 0xa9e3e905L); 134 | d = GG(d, a, b, c, groups[2], S22, 0xfcefa3f8L); 135 | c = GG(c, d, a, b, groups[7], S23, 0x676f02d9L); 136 | b = GG(b, c, d, a, groups[12], S24, 0x8d2a4c8aL); 137 | //第三轮 138 | a = HH(a, b, c, d, groups[5], S31, 0xfffa3942L); 139 | d = HH(d, a, b, c, groups[8], S32, 0x8771f681L); 140 | c = HH(c, d, a, b, groups[11], S33, 0x6d9d6122L); 141 | b = HH(b, c, d, a, groups[14], S34, 0xfde5380cL); 142 | a = HH(a, b, c, d, groups[1], S31, 0xa4beea44L); 143 | d = HH(d, a, b, c, groups[4], S32, 0x4bdecfa9L); 144 | c = HH(c, d, a, b, groups[7], S33, 0xf6bb4b60L); 145 | b = HH(b, c, d, a, groups[10], S34, 0xbebfbc70L); 146 | a = HH(a, b, c, d, groups[13], S31, 0x289b7ec6L); 147 | d = HH(d, a, b, c, groups[0], S32, 0xeaa127faL); 148 | c = HH(c, d, a, b, groups[3], S33, 0xd4ef3085L); 149 | b = HH(b, c, d, a, groups[6], S34, 0x4881d05L); 150 | a = HH(a, b, c, d, groups[9], S31, 0xd9d4d039L); 151 | d = HH(d, a, b, c, groups[12], S32, 0xe6db99e5L); 152 | c = HH(c, d, a, b, groups[15], S33, 0x1fa27cf8L); 153 | b = HH(b, c, d, a, groups[2], S34, 0xc4ac5665L); 154 | //第四轮 155 | a = II(a, b, c, d, groups[0], S41, 0xf4292244L); 156 | d = II(d, a, b, c, groups[7], S42, 0x432aff97L); 157 | c = II(c, d, a, b, groups[14], S43, 0xab9423a7L); 158 | b = II(b, c, d, a, groups[5], S44, 0xfc93a039L); 159 | a = II(a, b, c, d, groups[12], S41, 0x655b59c3L); 160 | d = II(d, a, b, c, groups[3], S42, 0x8f0ccc92L); 161 | c = II(c, d, a, b, groups[10], S43, 0xffeff47dL); 162 | b = II(b, c, d, a, groups[1], S44, 0x85845dd1L); 163 | a = II(a, b, c, d, groups[8], S41, 0x6fa87e4fL); 164 | d = II(d, a, b, c, groups[15], S42, 0xfe2ce6e0L); 165 | c = II(c, d, a, b, groups[6], S43, 0xa3014314L); 166 | b = II(b, c, d, a, groups[13], S44, 0x4e0811a1L); 167 | a = II(a, b, c, d, groups[4], S41, 0xf7537e82L); 168 | d = II(d, a, b, c, groups[11], S42, 0xbd3af235L); 169 | c = II(c, d, a, b, groups[2], S43, 0x2ad7d2bbL); 170 | b = II(b, c, d, a, groups[9], S44, 0xeb86d391L); 171 | 172 | result[0] += a; //加到先前计算结果中 173 | result[1] += b; 174 | result[2] += c; 175 | result[3] += d; 176 | result[0]=result[0]&0xFFFFFFFFL; 177 | result[1]=result[1]&0xFFFFFFFFL; 178 | result[2]=result[2]&0xFFFFFFFFL; 179 | result[3]=result[3]&0xFFFFFFFFL; 180 | } 181 | private long DealHi(byte b){ //需要对符号位进行处理 182 | return b < 0 ? b & 0x7F + 128 : b; 183 | } 184 | private long[] Create_NewGroup(byte[] inputBytes,int index){ 185 | long [] temp=new long[16]; //将每一个512位的分组再细分成16个小组,每个小组64位(8个字节) 186 | for(int i=0;i<16;i++){ 187 | temp[i]=DealHi(inputBytes[4*i+index])| 188 | (DealHi(inputBytes[4*i+1+index]))<<8| 189 | (DealHi(inputBytes[4*i+2+index]))<<16| 190 | (DealHi(inputBytes[4*i+3+index]))<<24; 191 | } 192 | return temp; 193 | } 194 | private long F(long x, long y, long z) { 195 | return (x & y) | ((~x) & z); 196 | } 197 | private long G(long x, long y, long z) { 198 | return (x & z) | (y & (~z)); 199 | } 200 | private static long H(long x, long y, long z) { 201 | return x ^ y ^ z; 202 | } 203 | private long I(long x, long y, long z) { 204 | return y ^ (x | (~z)); 205 | } 206 | private long FF(long a, long b, long c, long d, long x, long s, 207 | long ac) { 208 | a += (F(b, c, d)&0xFFFFFFFFL) + x + ac; 209 | a = ((a&0xFFFFFFFFL)<< s) | ((a&0xFFFFFFFFL) >>> (32 - s)); 210 | a += b; 211 | return (a&0xFFFFFFFFL); 212 | } 213 | private long GG(long a, long b, long c, long d, long x, long s, 214 | long ac) { 215 | a += (G(b, c, d)&0xFFFFFFFFL) + x + ac; 216 | a = ((a&0xFFFFFFFFL) << s) | ((a&0xFFFFFFFFL) >>> (32 - s)); 217 | a += b; 218 | return (a&0xFFFFFFFFL); 219 | } 220 | private long HH(long a, long b, long c, long d, long x, long s, 221 | long ac) { 222 | a += (H(b, c, d)&0xFFFFFFFFL) + x + ac; 223 | a = ((a&0xFFFFFFFFL) << s) | ((a&0xFFFFFFFFL) >>> (32 - s)); 224 | a += b; 225 | return (a&0xFFFFFFFFL); 226 | } 227 | private long II(long a, long b, long c, long d, long x, long s, 228 | long ac) { 229 | a += (I(b, c, d)&0xFFFFFFFFL) + x + ac; 230 | a = ((a&0xFFFFFFFFL) << s) | ((a&0xFFFFFFFFL) >>> (32 - s)); 231 | a += b; 232 | return (a&0xFFFFFFFFL); 233 | } 234 | } 235 | public class IOT_md5 { 236 | public static void main(String []args){ 237 | String str="Embrace the glorious mess that you are"; 238 | MD5 md=new MD5(str); 239 | } 240 | } 241 | -------------------------------------------------------------------------------- /IOT_Experiment/源代码/Kaisa.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | class Function{ 4 | public: 5 | Function(string str){ 6 | this->str=str; 7 | } 8 | void Encrypt(int); 9 | void Decode(int); 10 | void Decode_violent(); 11 | 12 | private: 13 | string str,res; 14 | string result[26]; 15 | }; 16 | 17 | void Function::Encrypt(int key) { 18 | for (int i = 0; i < str.size(); ++i) { 19 | if((str[i]<='Z'&&str[i]>='A')||(str[i]<='z'&&str[i]>='a')){ 20 | if((str[i]<='Z'&&str[i]>='A'&&str[i]+key>'Z')||(str[i]<='z'&&str[i]>='a'&&str[i]+key>'z')) res+=str[i]+key-26; 21 | else res+=str[i]+key; 22 | } else{ 23 | res+=str[i]; 24 | } 25 | } 26 | cout<<"-----------Encryption Result-----------"<='A')||(str[i]<='z'&&str[i]>='a')){ 33 | if((str[i]<='Z'&&str[i]>='A'&&str[i]-key<'A')||(str[i]<='z'&&str[i]>='a'&&str[i]-key<'a')) res+=str[i]-key+26; 34 | else res+=str[i]-key; 35 | } else{ 36 | res+=str[i]; 37 | } 38 | } 39 | cout<<"-----------Decryption Result----------"<='A')||(str[i]<='z'&&str[i]>='a')){ 47 | if((str[i]<='Z'&&str[i]>='A'&&str[i]-j<'A')||(str[i]<='z'&&str[i]>='a'&&str[i]-j<'a')) result[j-1]+=str[i]-j+26; 48 | else result[j-1]+=str[i]-j; 49 | } else{ 50 | result[j-1]+=str[i]; 51 | } 52 | } 53 | } 54 | for (int i = 0; i < 25; ++i) { 55 | cout<<"----------KEY: "< Encrypt"< Decode"< Violence to decrypt"<>choice; 70 | getline(cin,by); 71 | cout<<"Please enter the string you want to operate on: "<>a; 79 | fc.Encrypt(a); 80 | break; 81 | } 82 | case 2:{ 83 | cout<<"Please enter the key: "; 84 | cin>>a; 85 | fc.Decode(a); 86 | break; 87 | } 88 | case 3:{ 89 | fc.Decode_violent(); 90 | break; 91 | } 92 | } 93 | return 0; 94 | } 95 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Course_Code 2 | 3 | https://travis1024.github.io/ 4 | 5 | 课程或其他开源代码文件 6 | --------------------------------------------------------------------------------