diff --git a/Bai001/Source.cpp b/Bai001/Source.cpp index 9e1927f..f06f4a8 100644 --- a/Bai001/Source.cpp +++ b/Bai001/Source.cpp @@ -1,8 +1,24 @@ -#include +#include ; + using namespace std; +int Tong(int); + +int Tong(int n) +{ + if (n == 0) + return 0; + int s = Tong(n - 1); + return (s + n * n); +} + int main() { + int k; + cout << "Nhap n: "; + cin >> k; - return 0; + int kq = Tong(k); + cout << "S(" << k << ")= " << kq; + return 1; } \ No newline at end of file diff --git a/Bai006/Source.cpp b/Bai006/Source.cpp index 9e1927f..874c220 100644 --- a/Bai006/Source.cpp +++ b/Bai006/Source.cpp @@ -1,8 +1,21 @@ #include +#include using namespace std; +float Tong(int); + int main() { - + int n; + cout << "Nhap n: "; + cin >> n; + cout << "\nKet qua cua S(" << n << ") la: " << setw(5) << setprecision(5) << Tong(n) << endl; return 0; +} + +float Tong(int n) { + if (n == 0) { + return 0; + } + return Tong(n - 1) + (float)n / (n + 1); } \ No newline at end of file diff --git a/Bai011/Source.cpp b/Bai011/Source.cpp index 9e1927f..fab35a6 100644 --- a/Bai011/Source.cpp +++ b/Bai011/Source.cpp @@ -1,8 +1,29 @@ #include +#include +#include +#include using namespace std; +int sum(int); + int main() { + int n; + cout << "\nEnter the value of n: "; + cin >> n; + while (n > INT_MAX || n < 0) + { + cout << "The inputted value of n is invalid. Please re-enter the value of n." << endl; + cout << "\nEnter the value of n: "; + cin >> n; + } + cout << "\nThe result of S(" << n << ") is: " << sum(n) << "." << endl; + return 0; +} - return 0; +int sum(int n) +{ + if (n == 0) + return 0; + return (sum(n - 1) + pow(n,4)); } \ No newline at end of file diff --git a/Bai016/Source.cpp b/Bai016/Source.cpp index 9e1927f..4bf00c5 100644 --- a/Bai016/Source.cpp +++ b/Bai016/Source.cpp @@ -1,8 +1,21 @@ #include using namespace std; +float Tong(int); + int main() { + int k; + cout << "Nhap so nguyen: "; + cin >> k; + float kq = Tong(k); + cout << "Tong la: " << kq; + return 1; +} - return 0; +float Tong(int n) +{ + if (n == 0) + return 0; + return (Tong(n - 1) + (float)1 / (n * (n + 1) * (n + 2))); } \ No newline at end of file diff --git a/Bai021/Source.cpp b/Bai021/Source.cpp index 9e1927f..cd9f65a 100644 --- a/Bai021/Source.cpp +++ b/Bai021/Source.cpp @@ -1,8 +1,23 @@ #include using namespace std; +float Tong(float, int); + int main() { + int k; + float y; + cout << "Nhap so nguyen: "; + cin >> k; + cin >> y; + float kq = Tong(y, k); + cout << "Ket qua la: " << kq; + return 1; +} - return 0; +float Tong(float x, int n) +{ + if (n == 0) + return x; + return (Tong(x, n - 1) * (x + n)); } \ No newline at end of file diff --git a/Bai026/Source.cpp b/Bai026/Source.cpp index 9e1927f..1a5e125 100644 --- a/Bai026/Source.cpp +++ b/Bai026/Source.cpp @@ -1,8 +1,19 @@ -#include +#include +#include using namespace std; - +float sum(int); int main() { - - return 0; + int n; + cin >> n; + float kq = sum(n); + cout << kq; + return 0; + +} +float sum(int n) +{ + if (n == 0) + return 0; + return sqrt(n + sum(n - 1)); } \ No newline at end of file diff --git a/Bai031/Source.cpp b/Bai031/Source.cpp index 9e1927f..3080e19 100644 --- a/Bai031/Source.cpp +++ b/Bai031/Source.cpp @@ -1,8 +1,23 @@ #include + using namespace std; +int TinhAn(int); + +int TinhAn(int n) +{ + if (n == 1) + return -2; + return 5 * TinhAn(n - 1) + 12; +} + int main() { + int k; + cout << "Nhap n: "; + cin >> k; - return 0; + int kq = TinhAn(k); + cout << "Ket qua la: " << kq; + return 1; } \ No newline at end of file diff --git a/Bai036/Source.cpp b/Bai036/Source.cpp index 9e1927f..22cfd12 100644 --- a/Bai036/Source.cpp +++ b/Bai036/Source.cpp @@ -1,8 +1,30 @@ #include +#include +#include using namespace std; +float Dem_so_le(int); + int main() { - + int n; + cout << "Nhap n: "; + cin >> n; + cout << "\nKet qua cua S(" << n << ") la: " << setw(5) << setprecision(5) << Dem_so_le(n) << endl; return 0; +} + +float Dem_so_le(int n) { + n = abs(n); + if (n <= 9) { + if (n % 2 == 1) { + return 1; + } + return 0; + } + int dv = n % 10; + if (dv % 2 == 1) { + return Dem_so_le(n / 10) + 1; + } + return Dem_so_le(n / 10); } \ No newline at end of file diff --git a/Bai041/Source.cpp b/Bai041/Source.cpp index 9e1927f..78a7e6f 100644 --- a/Bai041/Source.cpp +++ b/Bai041/Source.cpp @@ -1,8 +1,39 @@ #include +#include +#include using namespace std; +bool EvenExisted(int); + int main() { + int n; + cout << "\nEnter the value of n: "; + cin >> n; + while (n > INT_MAX || n < 0) + { + cout << "The inputted value of n is invalid. Please re-enter the value of n." << endl; + cout << "\nEnter the value of n: "; + cin >> n; + } + if (EvenExisted(n) == true) + cout << "\nIn the number " << n << " exists even digits." << endl; + else + cout << "\n In the number " << n << " doesn't exists even digits." << endl; + cout << endl; + return 0; +} - return 0; +bool EvenExisted(int n) +{ + n = abs(n); + if (n <= 9) + { + if (n % 2 == 0) + return true; + return false; + } + int unit = n % 10; + if (unit % 2 == 0) + return true; } \ No newline at end of file diff --git a/Bai046/Source.cpp b/Bai046/Source.cpp index 9e1927f..2216fd3 100644 --- a/Bai046/Source.cpp +++ b/Bai046/Source.cpp @@ -1,8 +1,26 @@ -#include +#include using namespace std; - +long long a(int); +long long b(int); int main() { - + int n; + cin >> n; + long long kq = a(n); + long long kq2 = b(n); + cout << kq << " " << kq2; return 0; +} +long long a(int n) +{ + if (n == 1) + return 2; + return 3 * b(n - 1) + 2 * a(n - 1); + +} +long long b(int n) +{ + if (n == 1) + return 1; + return a(n - 1) + 3 * b(n - 1); } \ No newline at end of file diff --git a/Bai051/Source.cpp b/Bai051/Source.cpp index 9e1927f..aa2b01e 100644 --- a/Bai051/Source.cpp +++ b/Bai051/Source.cpp @@ -1,8 +1,25 @@ #include +#include +#include using namespace std; +int S(int); + int main() { - + int n; + cout << "Nhap n: "; + cin >> n; + cout << "\nKet qua cua S(" << n << ") la: " << setw(5) << S(n) << endl; return 0; +} + +int S(int n) { + if (n == 0) { + return 0; + } + if (n == 1) { + return 1; + } + return (1 + n) * S(n - 1) - n * S(n - 2); } \ No newline at end of file diff --git a/Bai056/Source.cpp b/Bai056/Source.cpp index 9e1927f..7a6504f 100644 --- a/Bai056/Source.cpp +++ b/Bai056/Source.cpp @@ -1,8 +1,32 @@ #include +#include +#include using namespace std; +float sum(int); + int main() { + int n; + cout << "\nEnter the value of n: "; + cin >> n; + while (n > INT_MAX || n < 0) + { + cout << "The inputted value of n is invalid. Please re-enter the value of n." << endl; + cout << "\nEnter the value of n: "; + cin >> n; + } + cout << "\nThe result of S(" << n << ") is: " << setw(5) << setprecision(5) << sum(n) << "." << endl; + return 0; +} - return 0; +float sum(int n) +{ + if (n == 0) + return 0; + if (n == 1) + return 1; + float a = sum(n - 1); + float b = sum(n - 2); + return (a + (float)1 /(n + 1 / (a - b))); } \ No newline at end of file diff --git a/Bai061/Source.cpp b/Bai061/Source.cpp index 9e1927f..8860247 100644 --- a/Bai061/Source.cpp +++ b/Bai061/Source.cpp @@ -1,8 +1,59 @@ #include +#include +#include +#include +#include using namespace std; +void Input(int[], int&); +void QuickSort(int[], int, int); +void Output(int[], int); + int main() { - + int a[50000]; + int n; + Input(a, n); + QuickSort(a, 0, n - 1); + Output(a, n); return 0; -} \ No newline at end of file +} + +void Input(int a[], int& n) +{ + cout << "Nhap n: "; + cin >> n; + for (int i = 0; i < n; i++) { + cout << "Phan thu thu " << i << " la: "; + cin >> a[i]; + } +} + +void QuickSort(int a[], int l, int r) +{ + if (l >= r) + return; + int pivot = a[(l + r) / 2]; + int i = l, j = r; + while (i <= j) + { + while (a[i] < pivot) + i++; + while (a[j] > pivot) + j--; + if (i <= j) + { + swap(a[i], a[j]); + i++; + j--; + } + } + QuickSort(a, l, j); + QuickSort(a, i, r); +} + +void Output(int a[], int n) +{ + for (int i = 0; i < n; i++) + cout << setw(6) << a[i]; +} diff --git a/Bai066/Source.cpp b/Bai066/Source.cpp index 9e1927f..67168eb 100644 --- a/Bai066/Source.cpp +++ b/Bai066/Source.cpp @@ -1,8 +1,42 @@ #include +#include + using namespace std; -int main() -{ +void generate_permutations(vector& seq, vector& curr_perm, vector& used) { + if (curr_perm.size() == seq.size()) { + for (int i = 0; i < curr_perm.size(); i++) { + cout << curr_perm[i] << " "; + } + cout << endl; + return; + } + + for (int i = 0; i < seq.size(); i++) { + if (!used[i]) { + used[i] = true; + curr_perm.push_back(seq[i]); + generate_permutations(seq, curr_perm, used); + used[i] = false; + curr_perm.pop_back(); + } + } +} + +int main() { + vector seq; + int n; + cout << "Enter number of elements: "; + cin >> n; + cout << "Enter elements: "; + for (int i = 0; i < n; i++) { + int x; + cin >> x; + seq.push_back(x); + } + vector curr_perm; + vector used(n, false); + generate_permutations(seq, curr_perm, used); - return 0; -} \ No newline at end of file + return 0; +} diff --git a/Bai071/Source.cpp b/Bai071/Source.cpp index 9e1927f..cffbfaf 100644 --- a/Bai071/Source.cpp +++ b/Bai071/Source.cpp @@ -1,8 +1,56 @@ #include +#include using namespace std; +void Input(float[], int&); +void Enumerate(float[], int); +void Output(float[], int); + int main() { + int n = 0; + while (n <= 0) + { + cout << "\nEnter n: "; + cin >> n; + } + float* arr = new float[n]; + Input(arr, n); + cout << "\nYour inputted array is:" << endl; + Output(arr, n); + cout << "\nAll the negative elements in the inputted array:" << endl; + Enumerate(arr, n); + delete[]arr; + cout << endl; + return 1; +} + +void Input(float arr[], int& n) +{ + cout << "\nYour inputted array will have " << n << " elements." << endl; + for (int i = 0; i < n; i++) + { + cout << "Enter arr[" << i << "] element: "; + cin >> arr[i]; + } +} - return 0; +void Output(float arr[], int n) +{ + for (int i = 0; i < n; i++) + { + if (i % 20 == 0 && i != 0) + cout << endl; + cout << setw(10) << setprecision(6) << arr[i]; + } + cout << endl; +} + +void Enumerate(float arr[], int n) +{ + if (n == 0) + return; + Enumerate(arr, n - 1); + if (arr[n - 1] < 0) + cout << setw(10) << setprecision(6) << arr[n - 1]; } \ No newline at end of file diff --git a/Bai076/Source.cpp b/Bai076/Source.cpp index 9e1927f..621aa28 100644 --- a/Bai076/Source.cpp +++ b/Bai076/Source.cpp @@ -1,8 +1,49 @@ #include +#include using namespace std; +void Nhap(int[], int&); +void LietKe(int[], int); +int Kt3m(int); + int main() { + int* a = new int[100]; + int n; + Nhap(a, n); + LietKe(a, n); + delete[]a; + return 1; +} + +void Nhap(int a[], int& n) +{ + cout << "Nhap so luong phan tu trong mang: "; + cin >> n; + for (int i = 0; i < n; i++) + { + cout << "Phan tu a[" << i << "] = "; + cin >> a[i]; + } +} - return 0; +void LietKe(int a[], int n) +{ + if (n == 0) + return; + LietKe(a, n - 1); + if (Kt3m(a[n-1])) + cout << a[n - 1] << setw(5); +} + +int Kt3m(int x) +{ + while (x > 1) + { + int du = x % 3; + if (du != 0) + return 0; + x = x / 3; + } + return 1; } \ No newline at end of file diff --git a/Bai081/Source.cpp b/Bai081/Source.cpp index 9e1927f..305f434 100644 --- a/Bai081/Source.cpp +++ b/Bai081/Source.cpp @@ -1,8 +1,29 @@ -#include +#include +#include + using namespace std; +void LietKe(int[], int, int, int); + int main() { - + int a[100]; + int n, x, y; + cin >> n >> x >> y; + for (int i = 0; i < n; i++) + { + cin >> a[i]; + } + LietKe(a, n, x, y); return 0; +} +void LietKe(int a[], int n, int x, int y) +{ + if (n == 0) + return; + LietKe(a, n - 1, x, y); + if (a[n - 1] % 2 == 0 & a[n - 1] <= y && a[n - 1] >= x) + { + cout << setw(6) << a[n - 1]; + } } \ No newline at end of file diff --git a/Bai086/Source.cpp b/Bai086/Source.cpp index 9e1927f..bbac36a 100644 --- a/Bai086/Source.cpp +++ b/Bai086/Source.cpp @@ -1,8 +1,27 @@ -#include +#include +#include using namespace std; - +float Tong(float[], int); +void Nhap(float[], int&); int main() { - + float a[100]; + int n; + Nhap(a, n); + float kq=Tong(a, n); + cout << "Tong cac phan tu trong mang 1 chieu la :" << kq; return 0; -} \ No newline at end of file +} +float Tong(float a[], int n) +{ + if (n == 0) + return 0; + return Tong(a, n - 1) + a[n - 1]; +} +void Nhap(float a[], int& n) +{ + cout << "Nhap n:"; + cin >> n; + for (int i = 0; i < n; i++) cin >> a[i]; +} + \ No newline at end of file diff --git a/Bai091/Source.cpp b/Bai091/Source.cpp index 9e1927f..1d38191 100644 --- a/Bai091/Source.cpp +++ b/Bai091/Source.cpp @@ -1,8 +1,56 @@ #include +#include + using namespace std; -int main() +int ChuSoDau(int); +int TongGiaTri(int[], int); +void Nhap(int[], int&); +void Xuat(int[], int); + +int TongGiaTri(int a[], int n) { + if (n == 0) + return 0; + int s = TongGiaTri(a, n - 1); + if (ChuSoDau(a[n - 1]) % 2 != 0) + s = s + a[n - 1]; + return s; +} - return 0; +int ChuSoDau(int n) +{ + n = abs(n); + if (n <= 9) + return n; + return ChuSoDau(n / 10); +} + +void Nhap(int a[], int& n) +{ + cout << "Nhap n: "; + cin >> n; + for (int i = 0; i <= n - 1; i++) + { + cout << "Nhap a[" << i << "]: "; + cin >> a[i]; + } +} + +void Xuat(int a[], int n) +{ + if (n == 0) + return; + Xuat(a, n - 1); + cout << setw(6) << a[n - 1]; +} + +int main() +{ + int b[100]; + int k; + Nhap(b, k); + int kq=TongGiaTri(b, k); + cout << "Tong cac gia tri co chu so dau tien la chu so le: "< +#include +#include using namespace std; +int Liet_ke(int[], int); + int main() { - + int a[] = { 8,-8,6,-5,7,9,0 }; + cout<0&&a[n-1]%7==0) { + return dem + 1; + } + return dem; +} diff --git a/Bai101/Source.cpp b/Bai101/Source.cpp index 9e1927f..98a2878 100644 --- a/Bai101/Source.cpp +++ b/Bai101/Source.cpp @@ -1,8 +1,67 @@ #include +#include using namespace std; +void Input(int[], int&); +void Output(int[], int); +bool PerfNumChk(int); +int PerfNumCount(int[], int); + int main() { + int n = 0; + while (n <= 0) + { + cout << "\nEnter n: "; + cin >> n; + } + int* arr = new int[n]; + Input(arr, n); + cout << "\nYour inputted array is:" << endl; + Output(arr, n); + int counter = PerfNumCount(arr, n); + cout << "The number of perfect number in the inputted array is: " << counter << "."; + delete[]arr; + cout << endl; + return 1; +} + +void Input(int arr[], int& n) +{ + cout << "\nYour inputted array will have " << n << " elements." << endl; + for (int i = 0; i < n; i++) + { + cout << "Enter arr[" << i << "] element: "; + cin >> arr[i]; + } +} + +void Output(int arr[], int n) +{ + for (int i = 0; i < n; i++) + { + if (i % 20 == 0 && i != 0) + cout << endl; + cout << setw(10) << setprecision(6) << arr[i]; + } + cout << endl; +} + +bool PerfNumChk(int e) +{ + int sum = 0; + for (int i = 1; i < e; i++) + if (e % i == 0) + sum += i; + return (sum == e); +} - return 0; +int PerfNumCount(int arr[], int n) +{ + if (n == 0) + return 0; + int counter = PerfNumCount(arr, n - 1); + if (PerfNumChk(arr[n - 1]) == true) + counter++; + return counter; } \ No newline at end of file diff --git a/Bai106/Source.cpp b/Bai106/Source.cpp index 9e1927f..1985062 100644 --- a/Bai106/Source.cpp +++ b/Bai106/Source.cpp @@ -1,8 +1,40 @@ #include +#include using namespace std; +void Nhap(float[], int&, int&); +float XaNhat(float[], int, int); + int main() { + float* a = new float[100]; + int n, x; + Nhap(a, n, x); + float kq = XaNhat(a, n, x); + cout << "Gia tri xa x nhat la: " << kq; + delete[]a; + return 1; +} + +void Nhap(float a[], int& n, int& x) +{ + cout << "Nhap so luong phan tu trong mang: "; + cin >> n; + for (int i = 0; i < n; i++) + { + cout << "Phan tu a[" << i << "] = "; + cin >> a[i]; + } + cout << "Nhap phan tu x: "; + cin >> x; +} - return 0; +float XaNhat(float a[], int n, int x) +{ + if (n == 1) + return a[0]; + float lc = XaNhat(a, n - 1, x); + if (abs(a[n - 1] - x) > abs(lc - x)) + lc = a[n - 1]; + return lc; } \ No newline at end of file diff --git a/Bai111/Source.cpp b/Bai111/Source.cpp index 9e1927f..9390789 100644 --- a/Bai111/Source.cpp +++ b/Bai111/Source.cpp @@ -1,8 +1,33 @@ -#include +#include +#include + using namespace std; +float AmDau(float[], int); + int main() { - + float a[100]; + int n; + cin >> n; + for (int i = 0; i < n; i++) + { + cin >> a[i]; + } + float kq = AmDau(a, n); + cout << kq; + return 0; +} +float AmDau(float a[], int n) +{ + if (n == 0) + return 0; + float lc = AmDau(a, n - 1); + if (lc != 0) + { + return lc; + } + if (a[n - 1] < 0) + return a[n - 1]; return 0; } \ No newline at end of file diff --git a/Bai116/Source.cpp b/Bai116/Source.cpp index 9e1927f..74ca973 100644 --- a/Bai116/Source.cpp +++ b/Bai116/Source.cpp @@ -1,8 +1,31 @@ -#include +#include using namespace std; - +float DuongCuoi(float[], int); +void Nhap(float[], int&); int main() { - + float a[100]; + int n; + Nhap(a, n); + float dc = DuongCuoi(a, n); + if (dc != -1) + cout << "gia tri duong cuoi trong mang la :" << dc; + else + cout << "Khong co gia tri duong trong mang"; return 0; +} +void Nhap(float a[], int& n) +{ + cout << "Nhap n:"; + cin >> n; + for (int i = 0; i < n; i++) + cin >> a[i]; +} +float DuongCuoi(float a[], int n) +{ + if (n == 1) + return -1; + if (a[n - 1] > 0) + return a[n - 1]; + return DuongCuoi(a, n - 1); } \ No newline at end of file diff --git a/Bai121/Source.cpp b/Bai121/Source.cpp index 9e1927f..f45294f 100644 --- a/Bai121/Source.cpp +++ b/Bai121/Source.cpp @@ -1,8 +1,67 @@ #include +#include + using namespace std; -int main() +int DoiXungDau(int[], int); +bool ktDoiXung(int); +void Nhap(int[], int&); +void Xuat(int[], int); + +int DoiXungDau(int a[], int n) { + if (n == 0) + return 10; + int lc = DoiXungDau(a, n - 1); + if (lc != 10) + return lc; + if (ktDoiXung(a[n - 1])) + return a[n-1]; + return 10; +} - return 0; +bool ktDoiXung(int n) +{ + int t = abs(n); + int dn = 0; + while (t != 0) + { + dn = dn * 10 + t % 10; + t /= 10; + } + if (dn == abs(n)) + return true; + return false; +} + +void Nhap(int a[], int& n) +{ + cout << "Nhap n: "; + cin >> n; + for (int i = 0; i <= n - 1; i++) + { + cout << "Nhap a[" << i << "]: "; + cin >> a[i]; + } +} + +void Xuat(int a[], int n) +{ + if (n == 0) + return; + Xuat(a, n - 1); + cout << setw(6) << a[n - 1]; +} + +int main() +{ + int b[100]; + int k; + Nhap(b, k); + int kq = DoiXungDau(b, k); + if (kq == 10) + cout << "Mang khong co gia tri doi xung."; + else + cout << "So so doi xung dau tien la: " << kq; + return 1; } \ No newline at end of file diff --git a/Bai126/Source.cpp b/Bai126/Source.cpp index 9e1927f..0bf763e 100644 --- a/Bai126/Source.cpp +++ b/Bai126/Source.cpp @@ -1,8 +1,27 @@ #include +#include +#include using namespace std; +int Tim_doan(int[], int); + int main() { - + int a[] = { 7,-5,9,6,-5,7,9,0 }; + cout << Tim_doan(a, 8); return 0; +} + +int Tim_doan(int a[], int n) { + if (n == 1) { + if (a[0] % 2 == 0) { + return 0; + } + return -1; + } + int lc = Tim_doan(a, n - 1); + if (lc == -1 && a[n - 1] % 2 == 0) { + return n - 1; + } + return lc; } \ No newline at end of file diff --git a/Bai131/Source.cpp b/Bai131/Source.cpp index 9e1927f..9e350a3 100644 --- a/Bai131/Source.cpp +++ b/Bai131/Source.cpp @@ -1,8 +1,72 @@ #include +#include using namespace std; +void Input(int[], int&); +void Output(int[], int); +bool PrimeNumChk(int); +int MaxPrimeEle(int[], int); + int main() { + int n = 0; + while (n <= 0) + { + cout << "\nEnter n: "; + cin >> n; + } + int* arr = new int[n]; + Input(arr, n); + cout << "\nYour inputted array is:" << endl; + Output(arr, n); + int mpe = MaxPrimeEle(arr, n); + if (mpe == 0) + cout << "\nThe inputted array doesn't have any prime number/element."; + else + cout << "\nThe biggest prime number/element in the inputted array is: " << mpe << "."; + delete[]arr; + cout << endl; + return 1; +} + +void Input(int arr[], int& n) +{ + cout << "\nYour inputted array will have " << n << " elements." << endl; + for (int i = 0; i < n; i++) + { + cout << "Enter arr[" << i << "] element: "; + cin >> arr[i]; + } +} + +void Output(int arr[], int n) +{ + for (int i = 0; i < n; i++) + { + if (i % 20 == 0 && i != 0) + cout << endl; + cout << setw(10) << setprecision(6) << arr[i]; + } + cout << endl; +} + +bool PrimeNumChk(int n) +{ + if (n <= 1) + return false; + for (int i = 2; i * i <= n; i++) + if (n % i == 0) + return false; + return true; +} - return 0; +int MaxPrimeEle(int arr[], int n) +{ + if (n == 0) + return 0; + int decoy = MaxPrimeEle(arr, n - 1); + if (PrimeNumChk(arr[n - 1]) == false) + return decoy; + if (decoy == 0) + return arr[n - 1]; } \ No newline at end of file diff --git a/Bai136/Source.cpp b/Bai136/Source.cpp index 9e1927f..f533b7c 100644 --- a/Bai136/Source.cpp +++ b/Bai136/Source.cpp @@ -1,8 +1,54 @@ #include +#include using namespace std; +void Nhap(int[], int&); +int LonNhat(int[], int); +bool Ktdang5m(int); + int main() { + int* a = new int[100]; + int n; + Nhap(a, n); + int kq = LonNhat(a, n); + cout << "So co dang 5m lon nhat la: " << kq; + delete[]a; + return 1; +} + +void Nhap(int a[], int& n) +{ + cout << "Nhap so luong phan tu trong mang: "; + cin >> n; + for (int i = 0; i < n; i++) + { + cout << "Phan tu a[" << i << "] = "; + cin >> a[i]; + } +} - return 0; +int LonNhat(int a[], int n) +{ + if (n == 0) + return 0; + int lc = LonNhat(a, n - 1); + if (!Ktdang5m(a[n - 1])) + return lc; + if (lc == 0) + return a[n - 1]; + if (a[n - 1] > lc) + lc = a[n - 1]; + return lc; +} + +bool Ktdang5m(int x) +{ + while (x > 1) + { + if (x % 5 != 0) + return 0; + x = x / 5; + } + return 1; } \ No newline at end of file diff --git a/Bai141/Source.cpp b/Bai141/Source.cpp index 9e1927f..d6af01a 100644 --- a/Bai141/Source.cpp +++ b/Bai141/Source.cpp @@ -1,8 +1,28 @@ -#include +#include +#include + using namespace std; +int ktTonTai(int[], int); + int main() { - + int a[100]; + int n; + cin >> n; + for (int i = 0; i < n; i++) + { + cin >> a[i]; + } + int kq = ktTonTai(a, n); + cout << kq; return 0; +} +int ktTonTai(int a[], int n) +{ + if (n <= 1) + return 0; + if (a[n - 1] == 0 && a[n - 2] == 0) + return 1; + return ktTonTai(a, n - 1); } \ No newline at end of file diff --git a/Bai146/Source.cpp b/Bai146/Source.cpp index 9e1927f..01a8b5e 100644 --- a/Bai146/Source.cpp +++ b/Bai146/Source.cpp @@ -1,8 +1,37 @@ -#include +#include using namespace std; - +void Nhap(int[], int&); +int ktChanle(int[], int); int main() { - + int a[100]; + int n; + Nhap(a, n); + if (ktChanle(a, n) == 1) + cout << "Mang co tinh chan le"; + else + cout << "Mang khong co tinh chan le"; return 0; -} \ No newline at end of file +} +int ktChanle(int a[], int n) +{ + if (n == 0) + return 0; + if (n == 1) + return 0; + if (n == 2) { + if ((a[0] + a[1]) % 2 != 0) + return 1; + return 0; + } + if ((a[n - 1] + a[n - 2]) % 2 != 0) + if (ktChanle(a, n - 1) == 1) + return 1; + return 0; +} +void Nhap(int a[], int& n) +{ + cout << "Nhap n:"; + cin >> n; + for (int i = 0; i < n; i++) cin >> a[i]; +} diff --git a/Bai151/Source.cpp b/Bai151/Source.cpp index 9e1927f..0102a27 100644 --- a/Bai151/Source.cpp +++ b/Bai151/Source.cpp @@ -1,8 +1,55 @@ #include +#include + using namespace std; +void XayDung(float[], int, float[], int&); +void Nhap(float[], int&); +void Xuat(float[], int); + +void XayDung(float a[], int n, float b[], int& k) +{ + if (n == 0) + { + k = 0; + return; + } + XayDung(a, n - 1, b, k); + if (a[n - 1] < 0) + b[k++] = a[n - 1]; +} + +void Nhap(float a[], int& n) +{ + cout << "Nhap n: "; + cin >> n; + for (int i = 0; i <= n - 1; i++) + { + cout << "Nhap a[" << i << "]: "; + cin >> a[i]; + } +} + +void Xuat(float a[], int n) +{ + if (n == 0) + return; + Xuat(a, n - 1); + cout << setw(6) << a[n - 1]; +} + int main() { + float b[100]; + int k; + Nhap(b, k); + cout << "Mang ban dau: "; + Xuat(b, k); - return 0; + float c[100]; + int m; + XayDung(b, k, c, m); + cout << "\nMang ket qua"; + Xuat(c, m); + return 1; } \ No newline at end of file diff --git a/Bai156/Source.cpp b/Bai156/Source.cpp index 9e1927f..cdaa2e7 100644 --- a/Bai156/Source.cpp +++ b/Bai156/Source.cpp @@ -1,8 +1,42 @@ #include +#include +#include +#include using namespace std; +void xap_nguyen_to_tang(int a[], int n); +bool kt_nguyen_to(int x); + int main() { - + int a[8] = { 4,3,2,6,7,9,8,5}; + xap_nguyen_to_tang(a, 8); + for (int i = 0; i < 8; ++i) { + cout << a[i] << " "; + } return 0; +} + +void xap_nguyen_to_tang(int a[], int n) { + if (n == 1) { + return; + } + for (int i = 0; i <= n - 2; ++i) { + if (kt_nguyen_to(a[n - 1]) && kt_nguyen_to(a[i]) && a[i] > a[n - 1]) { + swap(a[i], a[n - 1]); + } + } + xap_nguyen_to_tang(a, n - 1); +} + +bool kt_nguyen_to(int x) { + if (x < 2) { + return false; + } + for (int i = 2; i<=x/2; ++i) { + if (x % i == 0) { + return false; + } + } + return true; } \ No newline at end of file diff --git a/Bai161/Source.cpp b/Bai161/Source.cpp index 9e1927f..e2a5f7b 100644 --- a/Bai161/Source.cpp +++ b/Bai161/Source.cpp @@ -1,8 +1,62 @@ #include +#include using namespace std; +void Input(float[], int&); +void Output(float[], int); +void DelPos(float[], int&, int); + + int main() { + int n = 0, pos; + while (n <= 0) + { + cout << "\nEnter n: "; + cin >> n; + } + float* arr = new float[n]; + Input(arr, n); + cout << "\nYour inputted array is:" << endl; + Output(arr, n); + cout << "\nEnter the position which you wanted to remove from the inputted array: "; + cin >> pos; + DelPos(arr, n, pos); + cout << "\nEdited array is:" << endl; + Output(arr, n); + delete[]arr; + cout << endl; + return 1; +} + +void Input(float arr[], int& n) +{ + cout << "\nYour inputted array will have " << n << " elements." << endl; + for (int i = 0; i < n; i++) + { + cout << "Enter arr[" << i << "] element: "; + cin >> arr[i]; + } +} - return 0; +void Output(float arr[], int n) +{ + for (int i = 0; i < n; i++) + { + if (i % 20 == 0 && i != 0) + cout << endl; + cout << setw(10) << setprecision(6) << arr[i]; + } + cout << endl; +} + +void DelPos(float arr[], int& n, int pos) +{ + if (pos == (n - 1)) + { + n--; + return; + } + arr[pos] = arr[pos + 1]; + DelPos(arr, n, pos + 1); } \ No newline at end of file diff --git a/Bai166/Source.cpp b/Bai166/Source.cpp index 9e1927f..d16dbdb 100644 --- a/Bai166/Source.cpp +++ b/Bai166/Source.cpp @@ -1,8 +1,58 @@ #include +#include using namespace std; +void Nhap(int[], int&); +void XuatCon(int[], int, int, int); +void XuatCon(int[], int, int); +void XuatCon(int[], int); + int main() { + int* a = new int[100]; + int n; + Nhap(a, n); + XuatCon(a, n); + delete[]a; + return 1; +} + +void Nhap(int a[], int& n) +{ + cout << "Nhap so luong phan tu trong mang: "; + cin >> n; + for (int i = 0; i < n; i++) + { + cout << "Phan tu a[" << i << "] = "; + cin >> a[i]; + } +} + +void XuatCon(int a[], int n, int vt, int l) +{ + if (l == 0) + return; + XuatCon(a, n, vt, l - 1); + cout << setw(4) << a[vt + l - 1]; +} + +void XuatCon(int a[], int n, int l) +{ + if (n < l) + return; + XuatCon(a, n - 1, l); + XuatCon(a, n, n - l, l); +} - return 0; -} \ No newline at end of file +void XuatCon(int a[], int n) +{ + if (n == 0) + return; + XuatCon(a, n - 1); + for (int l = 2; l <= n; l++) + { + cout << "Mang con co " << l << " phan tu la: "; + XuatCon(a, n, n - l, l); + cout << endl; + } +} diff --git a/Bai171/Source.cpp b/Bai171/Source.cpp index 9e1927f..a0a074d 100644 --- a/Bai171/Source.cpp +++ b/Bai171/Source.cpp @@ -1,8 +1,63 @@ #include +#include +#include + using namespace std; -int main() +void Nhap(float[], int); +int ktCon(float[], int, int, int); +int DemConGiam(float[], int, int); +int DemConGiam(float[], int); + +int main() { + float a[100]; + int n; + cout << "Nhap n: "; + cin >> n; + Nhap(a, n); + int kq = DemConGiam(a, n); + cout << "So luong con giam: " << kq; + return 1; +} +void Nhap(float a[], int n) +{ + for (int i = 0; i < n; i++) + { + cin >> a[i]; + } +} +int ktCon(float a[], int n, int vt, int l) { + int flag = 1; - return 0; + for (int i = 0; i < l - 1; i++) { + if (a[vt + i] < a[vt + i + 1]) + flag = 0; + } + return flag; +} +int DemConGiam(float a[], int n, int vt) +{ + if (vt == n - 1) + { + return 1; + } + int dem = 0; + for (int i = vt + 1; i < n; i++) + { + if (a[i] < a[vt]) + { + dem += DemConGiam(a, n, i); + } + } + return dem; +} +int DemConGiam(float a[], int n) +{ + int dem = 0; + for (int i = 0; i < n; i++) + { + dem += DemConGiam(a, n, i); + } + return dem; } \ No newline at end of file diff --git a/Bai176/Source.cpp b/Bai176/Source.cpp index 9e1927f..4df9b30 100644 --- a/Bai176/Source.cpp +++ b/Bai176/Source.cpp @@ -1,8 +1,35 @@ -#include +#include using namespace std; - +void Nhap(int[], int&); +void DuaVeDau(int[], int); int main() { - + int a[100]; + int n; + Nhap(a, n); + int i = 0; + DuaVeDau(a, n,i); + for (int i = 0; i < n; i++) + cout << a[i]; return 0; +} +void Nhap(int a[], int& n) +{ + cout << "Nhap n:"; + cin >> n; + for (int i = 0; i < n; i++) + cin >> a[i]; +} +void DuaVeDau(int a[], int n,int i) +{ + if (i >= n) return; + if (a[i] % 3 != 0) { + for (int j = i + 1; j < n; j++) { + if (a[j] % 3 == 0) { + swap(a[i], a[j]); + break; + } + } + } + DuaVeDau(a, n, i + 1); } \ No newline at end of file diff --git a/Bai186/Source.cpp b/Bai186/Source.cpp index 9e1927f..2020553 100644 --- a/Bai186/Source.cpp +++ b/Bai186/Source.cpp @@ -1,8 +1,43 @@ #include +#include +#include +#include using namespace std; +int dem_prime_pb(int a[], int n); +bool kt_nguyen_to(int x); + int main() { - + int a[8] = { 1,2,3,4,5,2,3,3 }; + cout << dem_prime_pb(a, 8); return 0; +} + +int dem_prime_pb(int a[], int n) { + int dem = 0; + for (int i = 0; i < n; ++i) { + if (kt_nguyen_to(a[i])) { + ++dem; + for (int j = 0; j < i; ++j) { + if (a[j] == a[i]) { + --dem; + break; + } + } + } + } + return dem; +} + +bool kt_nguyen_to(int x) { + if (x < 2) { + return false; + } + for (int i = 2; i <= x / 2; ++i) { + if (x % i == 0) { + return false; + } + } + return true; } \ No newline at end of file diff --git a/Bai191/Source.cpp b/Bai191/Source.cpp index 9e1927f..3c44584 100644 --- a/Bai191/Source.cpp +++ b/Bai191/Source.cpp @@ -1,8 +1,70 @@ #include +#include +#include using namespace std; +void Input(float[], int&); +void Output(float[], int); +int Closest(float[], int, float&, float&); + int main() { + int n = 0; + while (n <= 0) + { + cout << "\nEnter n: "; + cin >> n; + } + float* arr = new float[n]; + Input(arr, n); + cout << "\nYour inputted array is:" << endl; + Output(arr, n); + float x, y; + int checker = Closest(arr, n, x, y); + if (checker != -1) + cout << "Two closest elements in the inputted array are: {" << x << ", " << y << "}."; + delete[]arr; + cout << endl; + return 1; +} + +void Input(float arr[], int& n) +{ + cout << "\nYour inputted array will have " << n << " elements." << endl; + for (int i = 0; i < n; i++) + { + cout << "Enter arr[" << i << "] element: "; + cin >> arr[i]; + } +} +void Output(float arr[], int n) +{ + for (int i = 0; i < n; i++) + { + if (i % 20 == 0 && i != 0) + cout << endl; + cout << setw(10) << setprecision(6) << arr[i]; + } + cout << endl; +} + +int Closest(float arr[], int n, float& x, float& y) +{ + if (n < 2) + return -1; + sort(arr, arr + n); + float Dmin = abs(arr[1] - arr[0]); + x = arr[0]; + y = arr[1]; + for (int i = 0; i < n - 1; i++) + { + if (abs(arr[i + 1] - arr[i]) < Dmin) + { + Dmin = abs(arr[i + 1] - arr[i]); + x = arr[i]; + y = arr[i + 1]; + } + } return 0; } \ No newline at end of file diff --git a/docs/README.md b/docs/README.md index aa9580e..1239f75 100644 --- a/docs/README.md +++ b/docs/README.md @@ -13,7 +13,7 @@ [![GitHub contributors](https://img.shields.io/github/contributors/NMLT-NTTMK-K18/6-290-recursion?style=for-the-badge&color=FBF0B2)](../../../graphs/contributors) [![CodeFactor](https://img.shields.io/codefactor/grade/github/nmlt-nttmk-k18/6-290-recursion?style=for-the-badge)](https://www.codefactor.io/repository/github/nmlt-nttmk-k18/6-290-recursion) -[![WorkedProject Badge](https://img.shields.io/badge/progress-8%20%2F%20290-82A0D8?style=for-the-badge)](./UnworkedProject.md) +[![WorkedProject Badge](https://img.shields.io/badge/progress-46%20%2F%20290-82A0D8?style=for-the-badge)](./UnworkedProject.md) [![RAR Source](https://img.shields.io/badge/rar_source-download-FF8080?style=for-the-badge)](../../../releases/download/RAR/23520161_23520730_23520623_23521049_23521734_BT06.rar/) [![TXT Github Link](https://img.shields.io/badge/txt_github_link-download-8CB369?style=for-the-badge)](../../../releases/download/RAR/23520161_23520730_23520623_23521049_23521734_BT06.txt/) diff --git a/docs/UnworkedProject.md b/docs/UnworkedProject.md index 4fa9c5e..ab6efdf 100644 --- a/docs/UnworkedProject.md +++ b/docs/UnworkedProject.md @@ -3,285 +3,247 @@ List các file `Source.cpp` chưa làm: -1. [Bai001](../Bai001/Source.cpp) -2. [Bai002](../Bai002/Source.cpp) -3. [Bai003](../Bai003/Source.cpp) -4. [Bai004](../Bai004/Source.cpp) -5. [Bai005](../Bai005/Source.cpp) -6. [Bai006](../Bai006/Source.cpp) -7. [Bai007](../Bai007/Source.cpp) -8. [Bai008](../Bai008/Source.cpp) -9. [Bai009](../Bai009/Source.cpp) -10. [Bai010](../Bai010/Source.cpp) -11. [Bai011](../Bai011/Source.cpp) -12. [Bai012](../Bai012/Source.cpp) -13. [Bai013](../Bai013/Source.cpp) -14. [Bai014](../Bai014/Source.cpp) -15. [Bai015](../Bai015/Source.cpp) -16. [Bai016](../Bai016/Source.cpp) -17. [Bai017](../Bai017/Source.cpp) -18. [Bai018](../Bai018/Source.cpp) -19. [Bai019](../Bai019/Source.cpp) -20. [Bai020](../Bai020/Source.cpp) -21. [Bai021](../Bai021/Source.cpp) -22. [Bai022](../Bai022/Source.cpp) -23. [Bai023](../Bai023/Source.cpp) -24. [Bai024](../Bai024/Source.cpp) -25. [Bai025](../Bai025/Source.cpp) -26. [Bai026](../Bai026/Source.cpp) -27. [Bai027](../Bai027/Source.cpp) -28. [Bai028](../Bai028/Source.cpp) -29. [Bai029](../Bai029/Source.cpp) -30. [Bai030](../Bai030/Source.cpp) -31. [Bai031](../Bai031/Source.cpp) -32. [Bai032](../Bai032/Source.cpp) -33. [Bai033](../Bai033/Source.cpp) -34. [Bai034](../Bai034/Source.cpp) -35. [Bai035](../Bai035/Source.cpp) -36. [Bai036](../Bai036/Source.cpp) -37. [Bai037](../Bai037/Source.cpp) -38. [Bai038](../Bai038/Source.cpp) -39. [Bai039](../Bai039/Source.cpp) -40. [Bai040](../Bai040/Source.cpp) -41. [Bai041](../Bai041/Source.cpp) -42. [Bai042](../Bai042/Source.cpp) -43. [Bai043](../Bai043/Source.cpp) -44. [Bai044](../Bai044/Source.cpp) -45. [Bai045](../Bai045/Source.cpp) -46. [Bai046](../Bai046/Source.cpp) -47. [Bai047](../Bai047/Source.cpp) -48. [Bai048](../Bai048/Source.cpp) -49. [Bai049](../Bai049/Source.cpp) -50. [Bai050](../Bai050/Source.cpp) -51. [Bai051](../Bai051/Source.cpp) -52. [Bai052](../Bai052/Source.cpp) -53. [Bai053](../Bai053/Source.cpp) -54. [Bai054](../Bai054/Source.cpp) -55. [Bai055](../Bai055/Source.cpp) -56. [Bai056](../Bai056/Source.cpp) -57. [Bai057](../Bai057/Source.cpp) -58. [Bai058](../Bai058/Source.cpp) -59. [Bai059](../Bai059/Source.cpp) -60. [Bai060](../Bai060/Source.cpp) -61. [Bai061](../Bai061/Source.cpp) -62. [Bai062](../Bai062/Source.cpp) -63. [Bai063](../Bai063/Source.cpp) -64. [Bai064](../Bai064/Source.cpp) -65. [Bai065](../Bai065/Source.cpp) -66. [Bai066](../Bai066/Source.cpp) -67. [Bai067](../Bai067/Source.cpp) -68. [Bai068](../Bai068/Source.cpp) -69. [Bai069](../Bai069/Source.cpp) -70. [Bai070](../Bai070/Source.cpp) -71. [Bai071](../Bai071/Source.cpp) -72. [Bai072](../Bai072/Source.cpp) -73. [Bai073](../Bai073/Source.cpp) -74. [Bai074](../Bai074/Source.cpp) -75. [Bai075](../Bai075/Source.cpp) -76. [Bai076](../Bai076/Source.cpp) -77. [Bai077](../Bai077/Source.cpp) -78. [Bai078](../Bai078/Source.cpp) -79. [Bai079](../Bai079/Source.cpp) -80. [Bai080](../Bai080/Source.cpp) -81. [Bai081](../Bai081/Source.cpp) -82. [Bai082](../Bai082/Source.cpp) -83. [Bai083](../Bai083/Source.cpp) -84. [Bai084](../Bai084/Source.cpp) -85. [Bai085](../Bai085/Source.cpp) -86. [Bai086](../Bai086/Source.cpp) -87. [Bai087](../Bai087/Source.cpp) -88. [Bai088](../Bai088/Source.cpp) -89. [Bai089](../Bai089/Source.cpp) -90. [Bai090](../Bai090/Source.cpp) -91. [Bai091](../Bai091/Source.cpp) -92. [Bai092](../Bai092/Source.cpp) -93. [Bai093](../Bai093/Source.cpp) -94. [Bai094](../Bai094/Source.cpp) -95. [Bai095](../Bai095/Source.cpp) -96. [Bai096](../Bai096/Source.cpp) -97. [Bai097](../Bai097/Source.cpp) -98. [Bai098](../Bai098/Source.cpp) -99. [Bai099](../Bai099/Source.cpp) -100. [Bai100](../Bai100/Source.cpp) -101. [Bai101](../Bai101/Source.cpp) -102. [Bai102](../Bai102/Source.cpp) -103. [Bai103](../Bai103/Source.cpp) -104. [Bai104](../Bai104/Source.cpp) -105. [Bai105](../Bai105/Source.cpp) -106. [Bai106](../Bai106/Source.cpp) -107. [Bai107](../Bai107/Source.cpp) -108. [Bai108](../Bai108/Source.cpp) -109. [Bai109](../Bai109/Source.cpp) -110. [Bai110](../Bai110/Source.cpp) -111. [Bai111](../Bai111/Source.cpp) -112. [Bai112](../Bai112/Source.cpp) -113. [Bai113](../Bai113/Source.cpp) -114. [Bai114](../Bai114/Source.cpp) -115. [Bai115](../Bai115/Source.cpp) -116. [Bai116](../Bai116/Source.cpp) -117. [Bai117](../Bai117/Source.cpp) -118. [Bai118](../Bai118/Source.cpp) -119. [Bai119](../Bai119/Source.cpp) -120. [Bai120](../Bai120/Source.cpp) -121. [Bai121](../Bai121/Source.cpp) -122. [Bai122](../Bai122/Source.cpp) -123. [Bai123](../Bai123/Source.cpp) -124. [Bai124](../Bai124/Source.cpp) -125. [Bai125](../Bai125/Source.cpp) -126. [Bai126](../Bai126/Source.cpp) -127. [Bai127](../Bai127/Source.cpp) -128. [Bai128](../Bai128/Source.cpp) -129. [Bai129](../Bai129/Source.cpp) -130. [Bai130](../Bai130/Source.cpp) -131. [Bai131](../Bai131/Source.cpp) -132. [Bai132](../Bai132/Source.cpp) -133. [Bai133](../Bai133/Source.cpp) -134. [Bai134](../Bai134/Source.cpp) -135. [Bai135](../Bai135/Source.cpp) -136. [Bai136](../Bai136/Source.cpp) -137. [Bai137](../Bai137/Source.cpp) -138. [Bai138](../Bai138/Source.cpp) -139. [Bai139](../Bai139/Source.cpp) -140. [Bai140](../Bai140/Source.cpp) -141. [Bai141](../Bai141/Source.cpp) -142. [Bai142](../Bai142/Source.cpp) -143. [Bai143](../Bai143/Source.cpp) -144. [Bai144](../Bai144/Source.cpp) -145. [Bai145](../Bai145/Source.cpp) -146. [Bai146](../Bai146/Source.cpp) -147. [Bai147](../Bai147/Source.cpp) -148. [Bai148](../Bai148/Source.cpp) -149. [Bai149](../Bai149/Source.cpp) -150. [Bai150](../Bai150/Source.cpp) -151. [Bai151](../Bai151/Source.cpp) -152. [Bai152](../Bai152/Source.cpp) -153. [Bai153](../Bai153/Source.cpp) -154. [Bai154](../Bai154/Source.cpp) -155. [Bai155](../Bai155/Source.cpp) -156. [Bai156](../Bai156/Source.cpp) -157. [Bai157](../Bai157/Source.cpp) -158. [Bai158](../Bai158/Source.cpp) -159. [Bai159](../Bai159/Source.cpp) -160. [Bai160](../Bai160/Source.cpp) -161. [Bai161](../Bai161/Source.cpp) -162. [Bai162](../Bai162/Source.cpp) -163. [Bai163](../Bai163/Source.cpp) -164. [Bai164](../Bai164/Source.cpp) -165. [Bai165](../Bai165/Source.cpp) -166. [Bai166](../Bai166/Source.cpp) -167. [Bai167](../Bai167/Source.cpp) -168. [Bai168](../Bai168/Source.cpp) -169. [Bai169](../Bai169/Source.cpp) -170. [Bai170](../Bai170/Source.cpp) -171. [Bai171](../Bai171/Source.cpp) -172. [Bai172](../Bai172/Source.cpp) -173. [Bai173](../Bai173/Source.cpp) -174. [Bai174](../Bai174/Source.cpp) -175. [Bai175](../Bai175/Source.cpp) -176. [Bai176](../Bai176/Source.cpp) -177. [Bai177](../Bai177/Source.cpp) -178. [Bai178](../Bai178/Source.cpp) -179. [Bai179](../Bai179/Source.cpp) -180. [Bai180](../Bai180/Source.cpp) -181. [Bai181](../Bai181/Source.cpp) -182. [Bai182](../Bai182/Source.cpp) -183. [Bai183](../Bai183/Source.cpp) -184. [Bai184](../Bai184/Source.cpp) -185. [Bai185](../Bai185/Source.cpp) -186. [Bai186](../Bai186/Source.cpp) -187. [Bai187](../Bai187/Source.cpp) -188. [Bai188](../Bai188/Source.cpp) -189. [Bai189](../Bai189/Source.cpp) -190. [Bai190](../Bai190/Source.cpp) -191. [Bai191](../Bai191/Source.cpp) -192. [Bai192](../Bai192/Source.cpp) -193. [Bai193](../Bai193/Source.cpp) -194. [Bai194](../Bai194/Source.cpp) -195. [Bai195](../Bai195/Source.cpp) -196. [Bai197](../Bai197/Source.cpp) -197. [Bai198](../Bai198/Source.cpp) -198. [Bai199](../Bai199/Source.cpp) -199. [Bai200](../Bai200/Source.cpp) -200. [Bai202](../Bai202/Source.cpp) -201. [Bai203](../Bai203/Source.cpp) -202. [Bai204](../Bai204/Source.cpp) -203. [Bai205](../Bai205/Source.cpp) -204. [Bai207](../Bai207/Source.cpp) -205. [Bai208](../Bai208/Source.cpp) -206. [Bai209](../Bai209/Source.cpp) -207. [Bai210](../Bai210/Source.cpp) -208. [Bai212](../Bai212/Source.cpp) -209. [Bai213](../Bai213/Source.cpp) -210. [Bai214](../Bai214/Source.cpp) -211. [Bai215](../Bai215/Source.cpp) -212. [Bai217](../Bai217/Source.cpp) -213. [Bai218](../Bai218/Source.cpp) -214. [Bai219](../Bai219/Source.cpp) -215. [Bai220](../Bai220/Source.cpp) -216. [Bai222](../Bai222/Source.cpp) -217. [Bai223](../Bai223/Source.cpp) -218. [Bai224](../Bai224/Source.cpp) -219. [Bai225](../Bai225/Source.cpp) -220. [Bai227](../Bai227/Source.cpp) -221. [Bai228](../Bai228/Source.cpp) -222. [Bai229](../Bai229/Source.cpp) -223. [Bai230](../Bai230/Source.cpp) -224. [Bai232](../Bai232/Source.cpp) -225. [Bai233](../Bai233/Source.cpp) -226. [Bai234](../Bai234/Source.cpp) -227. [Bai235](../Bai235/Source.cpp) -228. [Bai236](../Bai236/Source.cpp) -229. [Bai237](../Bai237/Source.cpp) -230. [Bai238](../Bai238/Source.cpp) -231. [Bai239](../Bai239/Source.cpp) -232. [Bai240](../Bai240/Source.cpp) -233. [Bai241](../Bai241/Source.cpp) -234. [Bai242](../Bai242/Source.cpp) -235. [Bai243](../Bai243/Source.cpp) -236. [Bai244](../Bai244/Source.cpp) -237. [Bai245](../Bai245/Source.cpp) -238. [Bai246](../Bai246/Source.cpp) -239. [Bai247](../Bai247/Source.cpp) -240. [Bai248](../Bai248/Source.cpp) -241. [Bai249](../Bai249/Source.cpp) -242. [Bai250](../Bai250/Source.cpp) -243. [Bai251](../Bai251/Source.cpp) -244. [Bai252](../Bai252/Source.cpp) -245. [Bai253](../Bai253/Source.cpp) -246. [Bai254](../Bai254/Source.cpp) -247. [Bai255](../Bai255/Source.cpp) -248. [Bai256](../Bai256/Source.cpp) -249. [Bai257](../Bai257/Source.cpp) -250. [Bai258](../Bai258/Source.cpp) -251. [Bai259](../Bai259/Source.cpp) -252. [Bai260](../Bai260/Source.cpp) -253. [Bai261](../Bai261/Source.cpp) -254. [Bai262](../Bai262/Source.cpp) -255. [Bai263](../Bai263/Source.cpp) -256. [Bai264](../Bai264/Source.cpp) -257. [Bai265](../Bai265/Source.cpp) -258. [Bai266](../Bai266/Source.cpp) -259. [Bai267](../Bai267/Source.cpp) -260. [Bai268](../Bai268/Source.cpp) -261. [Bai269](../Bai269/Source.cpp) -262. [Bai270](../Bai270/Source.cpp) -263. [Bai271](../Bai271/Source.cpp) -264. [Bai272](../Bai272/Source.cpp) -265. [Bai273](../Bai273/Source.cpp) -266. [Bai274](../Bai274/Source.cpp) -267. [Bai275](../Bai275/Source.cpp) -268. [Bai276](../Bai276/Source.cpp) -269. [Bai277](../Bai277/Source.cpp) -270. [Bai278](../Bai278/Source.cpp) -271. [Bai279](../Bai279/Source.cpp) -272. [Bai280](../Bai280/Source.cpp) -273. [Bai281](../Bai281/Source.cpp) -274. [Bai282](../Bai282/Source.cpp) -275. [Bai283](../Bai283/Source.cpp) -276. [Bai284](../Bai284/Source.cpp) -277. [Bai285](../Bai285/Source.cpp) -278. [Bai286](../Bai286/Source.cpp) -279. [Bai287](../Bai287/Source.cpp) -280. [Bai288](../Bai288/Source.cpp) -281. [Bai289](../Bai289/Source.cpp) -282. [Bai290](../Bai290/Source.cpp) +1. [Bai002](../Bai002/Source.cpp) +2. [Bai003](../Bai003/Source.cpp) +3. [Bai004](../Bai004/Source.cpp) +4. [Bai005](../Bai005/Source.cpp) +5. [Bai007](../Bai007/Source.cpp) +6. [Bai008](../Bai008/Source.cpp) +7. [Bai009](../Bai009/Source.cpp) +8. [Bai010](../Bai010/Source.cpp) +9. [Bai012](../Bai012/Source.cpp) +10. [Bai013](../Bai013/Source.cpp) +11. [Bai014](../Bai014/Source.cpp) +12. [Bai015](../Bai015/Source.cpp) +13. [Bai017](../Bai017/Source.cpp) +14. [Bai018](../Bai018/Source.cpp) +15. [Bai019](../Bai019/Source.cpp) +16. [Bai020](../Bai020/Source.cpp) +17. [Bai022](../Bai022/Source.cpp) +18. [Bai023](../Bai023/Source.cpp) +19. [Bai024](../Bai024/Source.cpp) +20. [Bai025](../Bai025/Source.cpp) +21. [Bai027](../Bai027/Source.cpp) +22. [Bai028](../Bai028/Source.cpp) +23. [Bai029](../Bai029/Source.cpp) +24. [Bai030](../Bai030/Source.cpp) +25. [Bai032](../Bai032/Source.cpp) +26. [Bai033](../Bai033/Source.cpp) +27. [Bai034](../Bai034/Source.cpp) +28. [Bai035](../Bai035/Source.cpp) +29. [Bai037](../Bai037/Source.cpp) +30. [Bai038](../Bai038/Source.cpp) +31. [Bai039](../Bai039/Source.cpp) +32. [Bai040](../Bai040/Source.cpp) +33. [Bai042](../Bai042/Source.cpp) +34. [Bai043](../Bai043/Source.cpp) +35. [Bai044](../Bai044/Source.cpp) +36. [Bai045](../Bai045/Source.cpp) +37. [Bai047](../Bai047/Source.cpp) +38. [Bai048](../Bai048/Source.cpp) +39. [Bai049](../Bai049/Source.cpp) +40. [Bai050](../Bai050/Source.cpp) +41. [Bai052](../Bai052/Source.cpp) +42. [Bai053](../Bai053/Source.cpp) +43. [Bai054](../Bai054/Source.cpp) +44. [Bai055](../Bai055/Source.cpp) +45. [Bai057](../Bai057/Source.cpp) +46. [Bai058](../Bai058/Source.cpp) +47. [Bai059](../Bai059/Source.cpp) +48. [Bai060](../Bai060/Source.cpp) +49. [Bai062](../Bai062/Source.cpp) +50. [Bai063](../Bai063/Source.cpp) +51. [Bai064](../Bai064/Source.cpp) +52. [Bai065](../Bai065/Source.cpp) +53. [Bai067](../Bai067/Source.cpp) +54. [Bai068](../Bai068/Source.cpp) +55. [Bai069](../Bai069/Source.cpp) +56. [Bai070](../Bai070/Source.cpp) +57. [Bai072](../Bai072/Source.cpp) +58. [Bai073](../Bai073/Source.cpp) +59. [Bai074](../Bai074/Source.cpp) +60. [Bai075](../Bai075/Source.cpp) +61. [Bai077](../Bai077/Source.cpp) +62. [Bai078](../Bai078/Source.cpp) +63. [Bai079](../Bai079/Source.cpp) +64. [Bai080](../Bai080/Source.cpp) +65. [Bai082](../Bai082/Source.cpp) +66. [Bai083](../Bai083/Source.cpp) +67. [Bai084](../Bai084/Source.cpp) +68. [Bai085](../Bai085/Source.cpp) +69. [Bai087](../Bai087/Source.cpp) +70. [Bai088](../Bai088/Source.cpp) +71. [Bai089](../Bai089/Source.cpp) +72. [Bai090](../Bai090/Source.cpp) +73. [Bai092](../Bai092/Source.cpp) +74. [Bai093](../Bai093/Source.cpp) +75. [Bai094](../Bai094/Source.cpp) +76. [Bai095](../Bai095/Source.cpp) +77. [Bai097](../Bai097/Source.cpp) +78. [Bai098](../Bai098/Source.cpp) +79. [Bai099](../Bai099/Source.cpp) +80. [Bai100](../Bai100/Source.cpp) +81. [Bai102](../Bai102/Source.cpp) +82. [Bai103](../Bai103/Source.cpp) +83. [Bai104](../Bai104/Source.cpp) +84. [Bai105](../Bai105/Source.cpp) +85. [Bai107](../Bai107/Source.cpp) +86. [Bai108](../Bai108/Source.cpp) +87. [Bai109](../Bai109/Source.cpp) +88. [Bai110](../Bai110/Source.cpp) +89. [Bai112](../Bai112/Source.cpp) +90. [Bai113](../Bai113/Source.cpp) +91. [Bai114](../Bai114/Source.cpp) +92. [Bai115](../Bai115/Source.cpp) +93. [Bai117](../Bai117/Source.cpp) +94. [Bai118](../Bai118/Source.cpp) +95. [Bai119](../Bai119/Source.cpp) +96. [Bai120](../Bai120/Source.cpp) +97. [Bai122](../Bai122/Source.cpp) +98. [Bai123](../Bai123/Source.cpp) +99. [Bai124](../Bai124/Source.cpp) +100. [Bai125](../Bai125/Source.cpp) +101. [Bai127](../Bai127/Source.cpp) +102. [Bai128](../Bai128/Source.cpp) +103. [Bai129](../Bai129/Source.cpp) +104. [Bai130](../Bai130/Source.cpp) +105. [Bai132](../Bai132/Source.cpp) +106. [Bai133](../Bai133/Source.cpp) +107. [Bai134](../Bai134/Source.cpp) +108. [Bai135](../Bai135/Source.cpp) +109. [Bai137](../Bai137/Source.cpp) +110. [Bai138](../Bai138/Source.cpp) +111. [Bai139](../Bai139/Source.cpp) +112. [Bai140](../Bai140/Source.cpp) +113. [Bai142](../Bai142/Source.cpp) +114. [Bai143](../Bai143/Source.cpp) +115. [Bai144](../Bai144/Source.cpp) +116. [Bai145](../Bai145/Source.cpp) +117. [Bai147](../Bai147/Source.cpp) +118. [Bai148](../Bai148/Source.cpp) +119. [Bai149](../Bai149/Source.cpp) +120. [Bai150](../Bai150/Source.cpp) +121. [Bai152](../Bai152/Source.cpp) +122. [Bai153](../Bai153/Source.cpp) +123. [Bai154](../Bai154/Source.cpp) +124. [Bai155](../Bai155/Source.cpp) +125. [Bai157](../Bai157/Source.cpp) +126. [Bai158](../Bai158/Source.cpp) +127. [Bai159](../Bai159/Source.cpp) +128. [Bai160](../Bai160/Source.cpp) +129. [Bai162](../Bai162/Source.cpp) +130. [Bai163](../Bai163/Source.cpp) +131. [Bai164](../Bai164/Source.cpp) +132. [Bai165](../Bai165/Source.cpp) +133. [Bai167](../Bai167/Source.cpp) +134. [Bai168](../Bai168/Source.cpp) +135. [Bai169](../Bai169/Source.cpp) +136. [Bai170](../Bai170/Source.cpp) +137. [Bai172](../Bai172/Source.cpp) +138. [Bai173](../Bai173/Source.cpp) +139. [Bai174](../Bai174/Source.cpp) +140. [Bai175](../Bai175/Source.cpp) +141. [Bai177](../Bai177/Source.cpp) +142. [Bai178](../Bai178/Source.cpp) +143. [Bai179](../Bai179/Source.cpp) +144. [Bai180](../Bai180/Source.cpp) +145. [Bai181](../Bai181/Source.cpp) +146. [Bai182](../Bai182/Source.cpp) +147. [Bai183](../Bai183/Source.cpp) +148. [Bai184](../Bai184/Source.cpp) +149. [Bai185](../Bai185/Source.cpp) +150. [Bai187](../Bai187/Source.cpp) +151. [Bai188](../Bai188/Source.cpp) +152. [Bai189](../Bai189/Source.cpp) +153. [Bai190](../Bai190/Source.cpp) +154. [Bai192](../Bai192/Source.cpp) +155. [Bai193](../Bai193/Source.cpp) +156. [Bai194](../Bai194/Source.cpp) +157. [Bai195](../Bai195/Source.cpp) +158. [Bai197](../Bai197/Source.cpp) +159. [Bai198](../Bai198/Source.cpp) +160. [Bai199](../Bai199/Source.cpp) +161. [Bai200](../Bai200/Source.cpp) +162. [Bai202](../Bai202/Source.cpp) +163. [Bai203](../Bai203/Source.cpp) +164. [Bai204](../Bai204/Source.cpp) +165. [Bai205](../Bai205/Source.cpp) +166. [Bai207](../Bai207/Source.cpp) +167. [Bai208](../Bai208/Source.cpp) +168. [Bai209](../Bai209/Source.cpp) +169. [Bai210](../Bai210/Source.cpp) +170. [Bai212](../Bai212/Source.cpp) +171. [Bai213](../Bai213/Source.cpp) +172. [Bai214](../Bai214/Source.cpp) +173. [Bai215](../Bai215/Source.cpp) +174. [Bai217](../Bai217/Source.cpp) +175. [Bai218](../Bai218/Source.cpp) +176. [Bai219](../Bai219/Source.cpp) +177. [Bai220](../Bai220/Source.cpp) +178. [Bai222](../Bai222/Source.cpp) +179. [Bai223](../Bai223/Source.cpp) +180. [Bai224](../Bai224/Source.cpp) +181. [Bai225](../Bai225/Source.cpp) +182. [Bai227](../Bai227/Source.cpp) +183. [Bai228](../Bai228/Source.cpp) +184. [Bai229](../Bai229/Source.cpp) +185. [Bai230](../Bai230/Source.cpp) +186. [Bai232](../Bai232/Source.cpp) +187. [Bai233](../Bai233/Source.cpp) +188. [Bai234](../Bai234/Source.cpp) +189. [Bai235](../Bai235/Source.cpp) +190. [Bai236](../Bai236/Source.cpp) +191. [Bai237](../Bai237/Source.cpp) +192. [Bai238](../Bai238/Source.cpp) +193. [Bai239](../Bai239/Source.cpp) +194. [Bai240](../Bai240/Source.cpp) +195. [Bai241](../Bai241/Source.cpp) +196. [Bai242](../Bai242/Source.cpp) +197. [Bai243](../Bai243/Source.cpp) +198. [Bai244](../Bai244/Source.cpp) +199. [Bai245](../Bai245/Source.cpp) +200. [Bai246](../Bai246/Source.cpp) +201. [Bai247](../Bai247/Source.cpp) +202. [Bai248](../Bai248/Source.cpp) +203. [Bai249](../Bai249/Source.cpp) +204. [Bai250](../Bai250/Source.cpp) +205. [Bai251](../Bai251/Source.cpp) +206. [Bai252](../Bai252/Source.cpp) +207. [Bai253](../Bai253/Source.cpp) +208. [Bai254](../Bai254/Source.cpp) +209. [Bai255](../Bai255/Source.cpp) +210. [Bai256](../Bai256/Source.cpp) +211. [Bai257](../Bai257/Source.cpp) +212. [Bai258](../Bai258/Source.cpp) +213. [Bai259](../Bai259/Source.cpp) +214. [Bai260](../Bai260/Source.cpp) +215. [Bai261](../Bai261/Source.cpp) +216. [Bai262](../Bai262/Source.cpp) +217. [Bai263](../Bai263/Source.cpp) +218. [Bai264](../Bai264/Source.cpp) +219. [Bai265](../Bai265/Source.cpp) +220. [Bai266](../Bai266/Source.cpp) +221. [Bai267](../Bai267/Source.cpp) +222. [Bai268](../Bai268/Source.cpp) +223. [Bai269](../Bai269/Source.cpp) +224. [Bai270](../Bai270/Source.cpp) +225. [Bai271](../Bai271/Source.cpp) +226. [Bai272](../Bai272/Source.cpp) +227. [Bai273](../Bai273/Source.cpp) +228. [Bai274](../Bai274/Source.cpp) +229. [Bai275](../Bai275/Source.cpp) +230. [Bai276](../Bai276/Source.cpp) +231. [Bai277](../Bai277/Source.cpp) +232. [Bai278](../Bai278/Source.cpp) +233. [Bai279](../Bai279/Source.cpp) +234. [Bai280](../Bai280/Source.cpp) +235. [Bai281](../Bai281/Source.cpp) +236. [Bai282](../Bai282/Source.cpp) +237. [Bai283](../Bai283/Source.cpp) +238. [Bai284](../Bai284/Source.cpp) +239. [Bai285](../Bai285/Source.cpp) +240. [Bai286](../Bai286/Source.cpp) +241. [Bai287](../Bai287/Source.cpp) +242. [Bai288](../Bai288/Source.cpp) +243. [Bai289](../Bai289/Source.cpp) +244. [Bai290](../Bai290/Source.cpp)