原创 線性表單鏈表算法分析(C語言)

#include "pch.h" #include <stdio.h> #include <stdlib.h> #define TRUE 1 #define FALSE 0 #define OK 1 #define ERROR

原创 c++——運算符重載

一,實例 operator+ #include"pch.h" #include<iostream> using namespace std; //+運算法重載 class Box { public: double getVo

原创 c++——靜態成員靜態函數

#include<iostream> using namespace std; class Box { public: static int objectCount; Box(double l=2.0,double b=2

原创 c++——c文件操作(讀取、寫入)

寫入 #include"pch.h" #include <iostream> #pragma warning(disable:4996)//確保fprintf()函數可正常使用 using namespace std; int

原创 c++——this指針

#include <iostream> using namespace std; class Box { public: Box(double l=2.0,double b=2.0,double h=2.0) { c

原创 c++——重載函數

#include<iostream> using namespace std; //重載函數 class PrintData { public: void print(int i) { cout << "整數爲:" <<

原创 c++——拷貝構造函數

#include<iostream> using namespace std; class Line { public : int getLength(void); Line(int len); Line(const L

原创 java基礎——文件(夾)複製操作

package stream; import character.Hero; import java.io.*; import java.nio.charset.Charset; import java.util.Scanner

原创 c++——友元函數

#include <iostream> using namespace std; class Box { double width; public: friend void printWidth(Box box); vo

原创 c++——構造函數初始化順序()

#include<iostream> using namespace std; class Student1 { public: int a; int b; void fprint() { cout << "a =

原创 串的堆分配存儲表示與實現(c語言)

#include "pch.h" #include <stdio.h> #include <string> #define TRUE 1 #define FALSE 0 /*堆串結構定義*/ typedef struct {

原创 串的定長順序存儲表示與實現(c語言)

#include "pch.h" #include <stdio.h> #include <math.h> #include <string> #include <stdlib.h> #define MAXLEN 225 #de

原创 java基礎——集合遍歷

package collection; import character.APHero; import character.Hero; import property.Item; import java.util.ArrayL

原创 c++——繼承

#include <iostream> using namespace std; class Shape { public: void setWidth(int w) { width = w; } void s

原创 java基礎——字符串操作

package string; public class TestString { public static void main(String[] args) { String str = "擊