Skip to content

Instantly share code, notes, and snippets.

View tinwritescode's full-sized avatar
🏝️
Working remotely

Tin Nguyen tinwritescode

🏝️
Working remotely
View GitHub Profile
std::sort(students.begin(), students.end(), [](std::shared_ptr<Student> a, std::shared_ptr<Student> b) {
return a->getAvgMark() > b->getAvgMark();
});
"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",
@tinwritescode
tinwritescode / Dice.cpp
Created July 13, 2020 01:16
from Project 2 OOP, HCMUS
#include "Dice.h"
Dice::Dice()
{
m_rollTime = 0;
m_totalRoll = 0;
m_rollValues[0] = -1;
memset(m_rollValues, 0, sizeof(m_rollValues));
#include <iostream>
#include "Dice.h"
#include "../Random/Random.cpp"
using namespace std;
int main()
{
Dice dice;
char option;
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"
};
#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;
CXX := g++
CXX_FLAGS := -std=c++17 -ggdb -Wall
BIN := bin
INCLUDE := include
LIBRARIES :=
EXECUTABLE := main
{
// 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",
{
// 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": {
#include <iostream>
#include <string>
#include <fstream>
using namespace std;
struct Student {
int id{-1};
string name;
string gender;
double mark{ 0.0 };