Một số bài tập C _C++ NC 2026P16
Vi du:
#include <bits/stdc++.h>
using namespace std;
string chuyenvec_str(const vector&arr) {
string s;
for (auto x : arr) {
// chuyển double sang string, cắt gọn phần thập phân
ostringstream oss;
oss << x;
s += oss.str();
s += " ";
}
return s;
}
Ở đây dùng ostringstream thay cho to_string để kiểm soát định dạng số thực (ví dụ chỉ in đúng số thập phân có trong dữ liệu, không thêm 6 số 0 thừa).
//////////////////
Bài cấu trúc tổng hợp struct class vui:
#include
#include <bits/stdc++.h>
using namespace std;
class NhatTruong {
private:
string ss;
char ch;
vectorvec;
vector<pair> vp; // cần chỉ rõ kiểu pair
double db;
int so;
mapmp;
bitsetbits;
string df;
public:
NhatTruong(): ss(""), ch('\0'), vec(), vp(), db(0), so(0), mp(), df("") {}
string getss(){ return ss; }
char getch(){ return ch; }
vectorgetvec(){ return vec; }
vector<pair> getvp(){ return vp; }
double getdb(){ return db; }
int getso(){ return so; }
mapgetmp(){ return mp; }
string getdf(){ return df; }
void setws(string &dat){ ss = dat; }
void docf(const string &tenf){
ifstream fin(tenf);
if (!fin.is_open()){
cerr << "Khong the mo file du lieu\n";
ofstream fout(tenf);
fout.close();
return;
}
string lin;
bool first = true;
while (fin >> lin){
ss += lin + " ";
if (first) {
df = lin;
first = false;
}
}
fin.close();
}
void xuatf(string kq){
ofstream fout("kqoutput.txt");
if(!fout.is_open()){
cerr << "Khong the xuat file ket qua\n";
return;
}
fout << kq << endl;
fout.close();
}
bool chuyenstrstream_vec(){
vec.clear();
stringstream sss(ss);
double tmp;
while(sss >> tmp){
vec.push_back(tmp);
}
return true;
}
bool chuyenstrchar_vec() {
vec.clear();
int dau = 1;
double tmp = 0;
double heSo = 0.1;
bool dangDocSo = false;
bool dangDocThapPhan = false;
for (char c : ss) {
if (c == '-') {
dau = -1;
} else if (isdigit(c)) {
if (!dangDocThapPhan) {
tmp = tmp * 10 + (c - '0');
} else {
tmp = tmp + (c - '0') * heSo;
heSo /= 10;
}
dangDocSo = true;
} else if (c == '.') {
dangDocThapPhan = true;
} else {
if (dangDocSo) {
vec.push_back(tmp * dau);
tmp = 0;
dau = 1;
heSo = 0.1;
dangDocSo = false;
dangDocThapPhan = false;
}
}
}
if (dangDocSo) {
vec.push_back(tmp * dau);
}
return true;
}
string chuyenvec_str(vector&arr){
string s;
for(auto x:arr){
string tmp = to_string(x);
s += tmp + " ";
}
return s;
}
string chuyenvec_strn(const vector&arr) {
string s;
for (auto x : arr) {
ostringstream oss;
oss << x;
s += oss.str();
s += " ";
}
return s;
}
};
int main(int argc, char** argv) {
NhatTruong T;
cout << "Ban muon nhap du lieu tu file hay truc tiep (f/p): ";
char tl;
cin >> tl;
if(tl == 'f' || tl == 'F'){
cout << "Ban hay nhap ten inputfile: ";
string ten;
cin >> ten;
T.docf(ten);
}
else {
cout << "Ban hay nhap chuoi du lieu dau vao cho chuong trinh: ";
string dv;
cin.ignore();
getline(cin, dv);
T.setws(dv);
}
T.chuyenstrstream_vec();
string s = T.getss();
char c = T.getch();
vectorv = T.getvec();
string sf = T.getdf();
string kq = T.chuyenvec_str(v);
T.xuatf(kq);
cout << "Chuc mung, ban hay enter va xem file kqoutput.txt\n";
return 0;
}
///////////////////////////&&Struct Class VoNhatTruong++MY AI&&\\\\\\\\\\\\\\\\\
Bài chương trình vui cấu trúc tổng hợp struct class Nhat Truong+Ai
#include
#include <bits/stdc++.h>
using namespace std;
class NhatTruong {
private:
string ss;
char ch;
vectorvec;
vector<pair> vp;
double db;
int so;
mapmp;
bitsetbits;
string df;
public:
NhatTruong(): ss(""), ch('\0'), vec(), vp(), db(0), so(0), mp(), df("") {}
// Getter
string getss(){ return ss; }
char getch(){ return ch; }
vectorgetvec(){ return vec; }
vector<pair> getvp(){ return vp; }
double getdb(){ return db; }
int getso(){ return so; }
mapgetmp(){ return mp; }
string getdf(){ return df; }
void setws(string &dat){ ss = dat; }
void docf(const string &tenf){
ifstream fin(tenf);
if (!fin.is_open()){
cerr << "Khong the mo file du lieu\n";
return;
}
string lin;
bool first = true;
while (fin >> lin){
ss += lin + " ";
if (first) {
df = lin;
first = false;
}
}
fin.close();
}
void xuatf(string kq){
ofstream fout("kqoutput.txt");
if(!fout.is_open()){
cerr << "Khong the xuat file ket qua\n";
return;
}
fout << kq << endl;
fout.close();
}
bool chuyenstrstream_vec(){
vec.clear();
stringstream sss(ss);
double tmp;
while(sss >> tmp){
vec.push_back(tmp);
}
return true;
}
// Các hàm bổ sung
double tongVec() {
double sum = 0;
for (auto x : vec) sum += x;
return sum;
}
double trungBinhVec() {
if (vec.empty()) return 0;
return tongVec() / vec.size();
}
double minVec() {
if (vec.empty()) return 0;
return *min_element(vec.begin(), vec.end());
}
double maxVec() {
if (vec.empty()) return 0;
return *max_element(vec.begin(), vec.end());
}
int demTu() {
stringstream ssin(ss);
string word;
int count = 0;
while (ssin >> word) count++;
return count;
}
string chuyenvec_str(vector&arr){
string s;
for(auto x:arr){
string tmp = to_string(x);
s += tmp + " ";
}
return s;
}
string chuyenvec_strn(const vector&arr) {
string s;
for (auto x : arr) {
ostringstream oss;
oss << x;
s += oss.str();
s += " ";
}
return s;
}
};
int main() {
NhatTruong T;
cout << "Ban muon nhap du lieu tu file hay truc tiep (f/p): ";
char tl;
cin >> tl;
if(tl == 'f' || tl == 'F'){
cout << "Nhap ten file input (vd: input.txt): ";
string ten;
cin >> ten;
T.docf(ten);
}
else {
cout << "Nhap chuoi du lieu dau vao: ";
cin.ignore();
string dv;
getline(cin, dv);
T.setws(dv);
}
T.chuyenstrstream_vec();
// Menu chọn chức năng
cout << "\n===== MENU =====\n";
cout << "1. Xuat vector\n";
cout << "2. Tinh tong\n";
cout << "3. Tinh trung binh\n";
cout << "4. Tim min\n";
cout << "5. Tim max\n";
cout << "6. Dem so tu trong chuoi\n";
cout << "7. Xuat ket qua ra file\n";
cout << "================\n";
int chon;
cout << "Moi ban chon chuc nang: ";
cin >> chon;
switch(chon){
case 1: {
vectorv = T.getvec();
cout << "Vector: " << T.chuyenvec_strn(v) << "\n";
break;
}
case 2: cout << "Tong = " << T.tongVec() << "\n"; break;
case 3: cout << "Trung binh = " << T.trungBinhVec() << "\n"; break;
case 4: cout << "Min = " << T.minVec() << "\n"; break;
case 5: cout << "Max = " << T.maxVec() << "\n"; break;
case 6: cout << "So tu trong chuoi = " << T.demTu() << "\n"; break;
case 7: {
vectorv = T.getvec();
string kq = T.chuyenvec_strn(v);
T.xuatf(kq);
cout << "Da xuat ket qua ra file kqoutput.txt\n";
break;
}
default: cout << "Lua chon khong hop le!\n";
}
return 0;
}
File intput.txt : 12.5 -3.14 7 20 5.5
///////////// Ai memory help
Võ Nhật Trường Nc+ My Ai Love28.06.2026
////////////////////Ok
Ví dụ:
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main() {
ifstream fin("data.txt");
string lin;
// Đọc từng từ
while (fin >> lin) {
cout << "Word: " << lin << endl;
}
fin.clear();
fin.seekg(0); // quay lại đầu file
// Đọc từng dòng
while (getline(fin, lin)) {
cout << "Line: " << lin << endl;
}
return 0;
}
/////////////////////
fin >> lin:
• Đây là toán tử trích xuất (operator>>) dùng cho kiểu dữ liệu cơ bản hoặc chuỗi (std::string).
• Khi dùng với std::string, nó sẽ đọc từng token (chuỗi cách nhau bởi khoảng trắng, tab, xuống dòng).
• Nghĩa là nếu file có dòng "Hello world", thì fin >> lin chỉ lấy "Hello" trước, lần gọi tiếp theo mới lấy "world".
• Không phù hợp nếu bạn muốn đọc nguyên cả dòng.
• std::getline(fin, lin):
• Hàm này đọc nguyên cả dòng từ fin cho đến khi gặp ký tự xuống dòng (\n).
• Nó giữ nguyên khoảng trắng, kể cả chuỗi rỗng, và cho bạn toàn bộ nội dung dòng.
• Đây là cách chuẩn khi bạn muốn xử lý dữ liệu theo từng dòng.
Lưu ý:
- stol sẽ đọc từ đầu chuỗi cho đến khi gặp ký tự không phải số. Nếu dòng có "123 abc", thì stol(lin) sẽ trả về 123.
- Nếu dòng không bắt đầu bằng số (ví dụ "abc123"), thì stol sẽ ném ngoại lệ std::invalid_argument.
- Nếu số quá lớn vượt phạm vi của long, nó sẽ ném std::out_of_range.
Nếu bạn chỉ muốn lấy số đầu tiên trong dòng, thì stol(lin) là cách nhanh gọn. Nhưng nếu dòng có nhiều số, bạn nên dùng std::istringstream để tách từng số:
#include <sstream>
string lin;
getline(fin, lin);
istringstream iss(lin);
long so;
iss >> so; // lấy số đầu tiên trong dòng
istringstream iss(lin); không tự động “lấy số cả dòng” đâu bạn nhé. Nó chỉ tạo một luồng nhập từ chuỗi lin. Sau đó bạn dùng toán tử >> để rút dữ liệu ra từng phần:
- Nếu lin = "123 456 789", thì:
istringstream iss(lin);
long so;
iss >> so; // lấy số đầu tiên: 123
iss >> so; // lần nữa: 456
iss >> so; // lần nữa: 789
Ví dụ:
#include <iostream>
#include <sstream>
#include <string>
using namespace std;
int main() {
string lin = "42 99 hello";
istringstream iss(lin);
long a, b;
string word;
iss >> a >> b >> word;
cout << "a = " << a << ", b = " << b << ", word = " << word << endl;
}
Hoặc :
#include <iostream>
#include <sstream>
#include <string>
using namespace std;
int main() {
string lin = "123 456 789";
istringstream iss(lin);
long so;
while (iss >> so) {
cout << "Số: " << to_string(so) << endl;
}
}
Ở đây: iss >> so sẽ lần lượt lấy từng số trong chuỗi.
to_string(so) chuyển ngược số thành chuỗi để bạn dễ in ra hoặc xử lý tiếp.
Như vậy, istringstream + to_string là combo khá gọn: đọc số từ chuỗi, rồi chuyển số thành chuỗi khi cần.
////////////////////////////////////
Vd:
#include <iostream>
#include <vector>
#include <string>
using namespace std;
vector<int> vii = {5, 7, 2};
string chuyenvii_str(const vector<int> &v = {}) {
const vector<int> &tmp = v.empty() ? vii : v;
if (tmp.empty()) return "";
string s;
for (auto x : tmp) {
s += to_string(x) + " ";
}
return s;
}
int main() {
cout << chuyenvii_str({10, 20, 30}) << endl; // "10 20 30 "
cout << chuyenvii_str() << endl; // "5 7 2 "
}
////////////////////////////////
Về ostringstream
- ostringstream là một lớp trong <sstream> cho phép bạn ghi dữ liệu vào một luồng chuỗi (string stream).
- Bạn có thể dùng toán tử << giống như khi ghi ra cout, nhưng thay vì in ra màn hình, dữ liệu sẽ được lưu trong một buffer nội bộ.
- Sau đó, bạn gọi oss.str() để lấy toàn bộ nội dung buffer đó dưới dạng std::string.
Ví dụ nhỏ:
ostringstream oss;
oss << 123 << " " << 456;
string s = oss.str(); // s = "123 456"
string chuyenvii_strn(const vector<int> &v = {}) {
const vector<int> &tmp = v.empty() ? vii : v;
if (tmp.empty()) return "";
string s;
for (auto x : tmp) {
ostringstream oss;
oss << x; // ghi số vào luồng
s += oss.str(); // lấy chuỗi từ luồng
s += " ";
}
return s;
}
Mỗi vòng lặp, bạn tạo một ostringstream mới, ghi số x vào, rồi lấy chuỗi bằng oss.str().
Kết quả giống như to_string(x), nhưng ostringstream linh hoạt hơn: bạn có thể định dạng số (ví dụ set độ chính xác, căn lề, hệ cơ số…).
///////////////////
Ví dụ :
#include <iostream>
#include <sstream>
#include <vector>
#include <string>
using namespace std;
vector<double> vec;
string ss = "1.5 2 3.75";
bool chuyenstrstream_vec(const string &si = "") {
string csi = si.empty() ? ss : si;
vec.clear();
stringstream sss(csi);
double tmp;
while (sss >> tmp) {
vec.push_back(tmp);
}
return (vec.size() > 0);
}
int main() {
chuyenstrstream_vec();
for (double x : vec) cout << x << " ";
}
Giải thích
- Bạn dùng stringstream sss(csi); và khai báo double tmp;.
- Khi đọc bằng sss >> tmp, toán tử >> sẽ cố gắng parse dữ liệu trong chuỗi thành số thực kiểu double.
- Vì vậy, hàm này xử lý được cả số nguyên lẫn số thực. Ví dụ:
- Chuỗi "1 2 3" → vector chứa {1.0, 2.0, 3.0}.
- Chuỗi "1.5 2.75 3" → vector chứa {1.5, 2.75, 3.0}.
///////////
VD:
#include <string>
#include <limits>
using namespace std;
double so = 123.45; // giá trị mặc định
string chuyendb_str(double ii = std::numeric_limits<double>::lowest()) {
double tmp = (ii == std::numeric_limits<double>::lowest()) ? so : ii;
return to_string(tmp);
}
Nếu muốn giá trị nhỏ nhất của double, phải dùng std::numeric_limits<double>::lowest() (cần #include <limits>).
////////////
Vidu:
#include <sstream>
#include <string>
using namespace std;
string df = "0"; // chuỗi mặc định
double chuyenstr_db(const string &si = "") {
string csi = si.empty() ? df : si;
istringstream sss(csi);
double tmp = 0.0;
sss >> tmp; // đọc số thực từ chuỗi
return tmp;
}
//////////////////////
Trong C++ bạn hoàn toàn có thể định nghĩa struct bên trong một class. Điều này thường dùng khi bạn muốn có một cấu trúc dữ liệu phụ trợ chỉ phục vụ cho class đó. Cú pháp:
class MyClass {
public:
// Định nghĩa struct bên trong class
struct Point {
int x;
int y;
};
// Biến thành viên dùng struct
Point p;
// Hàm thành viên có thể dùng struct
void setPoint(int a, int b) {
p.x = a;
p.y = b;
}
void printPoint() {
cout << "(" << p.x << ", " << p.y << ")" << endl;
}
};
int main() {
MyClass obj;
obj.setPoint(5, 7);
obj.printPoint(); // (5, 7)
// Dùng struct bên ngoài class
MyClass::Point another;
another.x = 10;
another.y = 20;
cout << "(" << another.x << ", " << another.y << ")" << endl;
}
Giải thích
- struct Point được định nghĩa bên trong class MyClass.
- Nó chỉ là một kiểu dữ liệu, bạn có thể khai báo biến kiểu Point trong class hoặc bên ngoài.
- Nếu struct được khai báo trong public: thì bên ngoài class cũng có thể dùng:
Nếu bạn khai báo trong private: thì chỉ các hàm thành viên của class mới truy cập được.
VD: MyClass::Point q;
q.x = 10; q.y = 20;
///////////////
Bài Nhật Trường tổng hợp một số cấu trúc STRUCT CLASS vui cùng Ai
#include <iostream>
#include <sstream>
#include <fstream>
#include <vector>
#include <map>
#include <bitset>
#include <limits>
#include <algorithm>
#include <bits/stdc++.h> // chỉ nên include cần thiết
using namespace std;
class MyClass {
public:
struct Point {
int x;
int y;
};
Point p;
void setPoint(int a, int b) {
p.x = a;
p.y = b;
}
void printPoint() {
cout << "(" << p.x << ", " << p.y << ")" << endl;
}
};
class NhatTruong {
private:
string ss;
char ch;
vector<double> vec;
vector<int> vii;
vector<pair<int,int>> vp;
vector<vector<double>> vvc;
double db;
int so;
map<long long,int> mp;
bitset<50> bits;
string df;
public:
NhatTruong(): ss(""), ch('\0'), vec(), vp(), db(0), so(0), mp(), df(""), vii(), vvc() {}
// Getter
string getss(){ return ss; }
char getch(){ return ch; }
vector<double> getvec(){ return vec; }
vector<pair<int,int>> getvp(){ return vp; }
double getdb(){ return db; }
int getso(){ return so; }
map<long long,int> getmp(){ return mp; }
string getdf(){ return df; }
vector<int> getvii(){ return vii; }
// Setter
void setws(const string &dat){ ss = dat; }
void setwdf(const string &dat) { df = dat; }
void setwso(int dat){ so = dat; }
void setwdb(double dat){ db = dat; }
void setwch(char dat){ ch = dat; }
void docf(const string &tenf){
ifstream fin(tenf);
if (!fin.is_open()){
cerr << "Khong the mo file du lieu\n";
ofstream fout(tenf);
fout.close();
return;
}
string lin;
bool first = true;
while (fin >> lin){
ss += lin + " ";
if (first) {
df = lin;
istringstream iss(df);
iss >> so;
first = false;
}
}
fin.close();
chuyenstrstream_vii();
}
void xuatf(const string& kq="", const string& teno = "") {
string tenof = teno.empty() ? "kqoutput.txt" : teno;
string kqof = kq.empty() ? "False" : kq;
ofstream fout(tenof);
if (!fout.is_open()) {
cerr << "Khong the xuat file ket qua\n";
return;
}
fout << kqof << endl;
fout.close();
}
bool chuyenstrstream_vec(const string &si = "") {
string csi = si.empty() ? ss : si;
vec.clear();
stringstream sss(csi);
double tmp;
while (sss >> tmp) {
vec.push_back(tmp);
}
return (vec.size()>0);
}
bool chuyenstrstream_vii(const string &si = "") {
string csi = si.empty() ? ss : si;
vii.clear();
istringstream sss(csi);
int tmp;
while (sss >> tmp) {
vii.push_back(tmp);
}
return (vii.size()>0);
}
// Các hàm bổ sung
double tongVec(const vector<double> &arr = {}) {
const vector<double> &tmp = arr.empty() ? vec : arr;
double sum = 0;
for (auto x : tmp) sum += x;
return sum;
}
int tongVii(const vector<int> &arr = {}) {
const vector<int> &tmp = arr.empty() ? vii : arr;
int sum = 0;
for (auto x : tmp) sum += x;
return sum;
}
double trungBinhVec(const vector<double> &arr = {}) {
const vector<double> &tmp = arr.empty() ? vec : arr;
if (tmp.empty()) return 0;
return tongVec(tmp) / tmp.size();
}
double minVec(const vector<double> &arr = {}) {
const vector<double> &tmp = arr.empty() ? vec : arr;
if (tmp.empty()) return 0;
return *min_element(tmp.begin(), tmp.end());
}
int minVii(const vector<int> &v = {}) {
const vector<int> &tmp = v.empty() ? vii : v;
if (tmp.empty()) return 0;
return *min_element(tmp.begin(), tmp.end());
}
double maxVec(const vector<double> &arr = {}) {
const vector<double> &tmp = arr.empty() ? vec : arr;
if (tmp.empty()) return 0;
return *max_element(tmp.begin(), tmp.end());
}
int maxVii(const vector<int> &v = {}) {
const vector<int> &tmp = v.empty() ? vii : v;
if (tmp.empty()) return 0;
return *max_element(tmp.begin(), tmp.end());
}
int demTu(const string &si="") {
string csi = si.empty() ? ss : si;
stringstream ssin(csi);
string word;
int count = 0;
while (ssin >> word) count++;
return count;
}
string chuyenvec_str(const vector<double> &arr={}){
const vector<double> &tmp = arr.empty() ? vec : arr;
if (tmp.empty()) return "";
string s;
for(auto x:tmp){
s += to_string(x) + " ";
}
return s;
}
string chuyenvec_strn(const vector<double> &arr={}) {
const vector<double> &tmp = arr.empty() ? vec : arr;
if (tmp.empty()) return "";
string s;
for (auto x : tmp) {
ostringstream oss;
oss << x;
s += oss.str();
s += " ";
}
return s;
}
string chuyenvii_str(const vector<int> &v = {}) {
const vector<int> &tmp = v.empty() ? vii : v;
if (tmp.empty()) return "";
string s;
for (auto x : tmp) {
s += to_string(x) + " ";
}
return s;
}
string chuyenvii_strn(const vector<int> &v={}) {
const vector<int> &tmp = v.empty() ? vii : v;
if (tmp.empty()) return "";
string s;
for (auto x : tmp) {
ostringstream oss;
oss << x;
s += oss.str();
s += " ";
}
return s;
}
string chuyenint_str(int ii = -1) {
int tmp = (ii == -1) ? so : ii;
return to_string(tmp);
}
string chuyendb_str(double ii = std::numeric_limits<double>::lowest()) {
double tmp = (ii == std::numeric_limits<double>::lowest()) ? db : ii;
return to_string(tmp);
}
double chuyenstr_db(const string &si = "") {
string csi = si.empty() ? df : si;
istringstream sss(csi);
double tmp = 0.0;
sss >> tmp;
return tmp;
}
int chuyenstr_int(const string &si = "") {
string csi = si.empty() ? df : si;
istringstream sss(csi);
int tmp = 0;
sss >> tmp;
return tmp;
}
};
int main() {
NhatTruong T;
cout << "Ban muon nhap du lieu tu file hay truc tiep (f/p): ";
char tl;
cin >> tl;
if(tl == 'f' || tl == 'F'){
cout << "Nhap ten file input (vd: input.txt): ";
string ten;
cin >> ten;
T.docf(ten);
}
else {
cout << "Nhap chuoi du lieu dau vao: ";
cin.ignore();
string dv;
getline(cin, dv);
T.setws(dv);
}
T.chuyenstrstream_vec();
cout << "Ban hay nhap ten tep muon xem ket qua hoac enter mac dinh: ";
string tenoff;
cin.ignore(numeric_limits<streamsize>::max(), '\n'); // bỏ ký tự thừa trước khi getline
getline(cin, tenoff);
int chon;
do {
cout << "\n===== MENU =====\n";
cout << "1. Xuat vector\n";
cout << "2. Tinh tong\n";
cout << "3. Tinh trung binh\n";
cout << "4. Tim min\n";
cout << "5. Tim max\n";
cout << "6. Dem so tu trong chuoi\n";
cout << "7. Xuat ket qua ra file\n";
cout << "0. Thoat\n";
cout << "================\n";
cout << "Moi ban chon chuc nang: ";
cin >> chon;
switch(chon){
case 1: {
vector<double> v = T.getvec();
cout << "Vector: " << T.chuyenvec_strn(v) << "\n";
break;
}
case 2: cout << "Tong = " << T.tongVec() << "\n"; break;
case 3: cout << "Trung binh = " << T.trungBinhVec() << "\n"; break;
case 4: cout << "Min = " << T.minVec() << "\n"; break;
case 5: cout << "Max = " << T.maxVec() << "\n"; break;
case 6: cout << "So tu trong chuoi = " << T.demTu() << "\n"; break;
case 7: {
vector<double> v = T.getvec();
string kq = T.chuyenvec_strn(v);
string tenout = tenoff.empty() ? "kqoutput.txt" : tenoff; // fallback tên file
T.xuatf(kq, tenout);
cout << "Da xuat ket qua ra file " << tenout << "\n";
break;
}
case 0: cout << "Thoat chuong trinh.\n"; break;
default: cout << "Lua chon khong hop le!\n";
}
} while(chon != 0);
return 0;
}
///////////// Ai memory help
Võ Nhật Trường Nc+ My Ai Love29.06.2026
////////////////////

Nhận xét
Đăng nhận xét