原创 C++ 不同類的對象數組的排序 模板

對不同類寫一個通用的排序函數,由於每個排序算法都需要一個作爲中間變量的臨時變量,不運用模板非常困難解決這個臨時變量的通用性,我想了很久,查了很久,問了很多人,最終終於有人解答出來合適的方法,就是用模板,利用模板的類型參數可以根據調入的參數

原创 warning deprecated conversion from string constant to char * 解決方案

https://www.cnblogs.com/kaituorensheng/p/3575403.html

原创 warning: deleting object of abstract/polymorphi class type which has non-virtual destructor

warning: deleting object of abstract class type 'XXXX' which has non-virtual destructor will cause undefined behaviour

原创 Java中 length 和 length() 方法的區別

在Java中, length方法用於獲取數組的長度。 int[] arr = new int[10]; System.out.println(arr.length); 而length()用於獲取String字符串中字符的個數。 St

原创 Java中 Int和Integer的區別

https://blog.csdn.net/DoWhatYouSay/article/details/82659239 int和Integer的區別 1、Integer是int的包裝類,int則是java的一種基本數據類型  2、Inte

原创 C/C++ 編譯報錯 printf was not declared in this scope

報錯: 'printf' was not declared in this scope   原因是這個 printf  函數需要頭文件 "stdio",但是程序中沒寫,解決辦法是在頭文件中加入此頭文件。 C語言加入 include<std

原创 Python網絡爬蟲(一)- 入門基礎

Python網絡爬蟲(一)- 入門基礎:https://www.jianshu.com/p/9dfbe35ce95b

原创 奇偶性 JAVA語言實驗 SDUT OJ1583

奇偶性 Time Limit: 1000 ms Memory Limit: 32768 KiB Submit Statistic Problem Description     判斷輸入的數據的奇偶性。 Input     輸入數據

原创 期末考試之分等級 JAVA語言實驗 SDUT OJ2251

期末考試之分等級 Time Limit: 1000 ms Memory Limit: 65536 KiB Submit Statistic Discuss Problem Description 期末考試結束了,老師想要根據學生們的成績劃

原创 閏年 JAVA語言實驗 SDUT OJ1580

閏年 Time Limit: 1000 ms Memory Limit: 32768 KiB Submit Statistic Problem Description 時間過得真快啊,又要過年了,同時,我們的人生也增長了一年的閱歷,又成

原创 A+B for Input-Output Practice (VII) JAVA語言實驗 SDUT OJ1016

A+B for Input-Output Practice (VII) Time Limit: 1000 ms Memory Limit: 65536 KiB Submit Statistic Discuss Problem Descri

原创 error: expected primary-expression before

出現報錯“error: expected primary-expression before XXX” 我的情況是因爲XXX變量的調用時,前方多加了變量類型關鍵字,刪掉這多於的關鍵字就沒了。

原创 C++編譯報錯“error: only constructors take member initializers”

C++編譯報錯“error: only constructors take member initializers” void Laborage::input(string No1, string Name1, double shoul

原创 C++運算符重載 ++,--,+,-,+=,-=,輸出輸入運算符

https://blog.csdn.net/wenqian1991/article/details/34147997 一、運算符的定義 運算符重載就是運算符的“一符多用”。重載運算符是具有特殊名稱的函數:保留字 operator 後接需定