This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| std::sort(students.begin(), students.end(), [](std::shared_ptr<Student> a, std::shared_ptr<Student> b) { | |
| return a->getAvgMark() > b->getAvgMark(); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| "An","Anh","Ao","Ánh","Ân","Âu Dương","Ấu","Bá","Bạc","Bạch","Bàn","Bàng","Bành","Bảo", | |
| "Bế","Bì","Biện","Bình","Bồ","Chriêng","Ca","Cái","Cai","Cam","Cảnh","Cao","Cáp","Cát", | |
| "Cầm","Cấn","Chế","Chiêm","Chu/Châu","Chung","Chúng","Chương","Chử","Cồ","Cổ","Công", | |
| "Cống","Cung","Cù","Cự","Dã","Danh","Diêm","Diệp","Doãn","Dư","Đái","Điều","Đan","Đàm", | |
| "Đào","Đầu","Đậu","Đèo","Điền","Đinh","Điêu","Đoàn","Đôn","Đống","Đồ","Đồng","Đổng","Đới", | |
| "Đương","Đường","Đức","Đăng","Giả","Giao","Giang","Giàng","Giáp","H'","H'ma","H'nia","Hầu", | |
| "Hà","Hạ","Hàn","Hán","Hề","Hi","Hình","Hoa","Hồng","Hùng","Hứa","Hướng","Kông","Kiểu","Kha", | |
| "Khà","Khương","Khâu","Khiếu","Khoa","Khổng","Khu","Khuất","Khúc","Kiều","Kim","Khai","Lyly", | |
| "La","Lã","Lãnh","Lạc","Lại","Lăng","Lâm","Lèng","Lều","Liêu","Liễu","Lò","Lô","Lỗ","Lộ","Luyện", | |
| "Lục","Lư","Lương","Lưu","Lý","Mùa","Ma","Mai","Mang","Mã","Mạc","Mạch","Mạnh","Mâu","Mầu/Màu", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "Dice.h" | |
| Dice::Dice() | |
| { | |
| m_rollTime = 0; | |
| m_totalRoll = 0; | |
| m_rollValues[0] = -1; | |
| memset(m_rollValues, 0, sizeof(m_rollValues)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include "Dice.h" | |
| #include "../Random/Random.cpp" | |
| using namespace std; | |
| int main() | |
| { | |
| Dice dice; | |
| char option; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| char* humanlizeString(const char *str) { | |
| char *result = new char[strlen(str) * 10]; | |
| const char *name[] = { | |
| "nghin", "trieu", "ti" | |
| }; | |
| const char *number[] = { | |
| "khong", "mot", "hai", "ba", "bon", | |
| "nam", "sau", "bay", "tam", "chin" | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "function.h" | |
| char* reverseString(char *str) { | |
| const int N = strlen(str); | |
| for(int i = 0; i < N / 2; i++) { | |
| swap(str[i], str[N - i - 1]); | |
| } | |
| return str; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CXX := g++ | |
| CXX_FLAGS := -std=c++17 -ggdb -Wall | |
| BIN := bin | |
| INCLUDE := include | |
| LIBRARIES := | |
| EXECUTABLE := main | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| // Use IntelliSense to learn about possible attributes. | |
| // Hover to view descriptions of existing attributes. | |
| // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | |
| "version": "0.2.0", | |
| "configurations": [ | |
| { | |
| "name": "(gdb) Launch", | |
| "type": "cppdbg", | |
| "request": "launch", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| // See https://go.microsoft.com/fwlink/?LinkId=733558 | |
| // for the documentation about the tasks.json format | |
| "version": "2.0.0", | |
| "tasks": [ | |
| { | |
| "label": "build", | |
| "type": "shell", | |
| "command": "make", | |
| "group": { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <string> | |
| #include <fstream> | |
| using namespace std; | |
| struct Student { | |
| int id{-1}; | |
| string name; | |
| string gender; | |
| double mark{ 0.0 }; |