Skip to content

Instantly share code, notes, and snippets.

View duyet's full-sized avatar

duyet duyet

View GitHub Profile
@duyet
duyet / reverse_list_without_temp_list_full.cpp
Last active August 29, 2015 14:02
Function to reverse a linked list
/* http://lvduit.com */
#include <iostream>
#include <time.h>
using namespace std;
const int MIN = 1;
const int MAX = 50;
typedef struct dNode {
#include <iostream>
#include <stdio.h>
#include <time.h>
using namespace std;
const int N = 5;
const int MIN = 1;
const int MAX = 50;
typedef struct _tnode {
@duyet
duyet / _list_full.cpp
Created June 27, 2014 09:01
Danh sách liên kết đơn
/* http://lvduit.com */
#include <iostream>
#include <time.h>
using namespace std;
const int MIN = 1;
const int MAX = 50;
typedef struct dNode {
#define MAX 1000
int main() {
FILE *input, *output;
int n; // Số lượng phần tử n
int array[MAX]; // Mảng aray chứa n số tiếp theo
input = fopen("input.txt","rt"); // Mở file input
fscanf(input,"%d",&n); // Nhập giá trị n
#include <stdio.h>
#define MAX 1000
int main() {
FILE *input, *output;
int n; // Số lượng phần tử n
int array[MAX]; // Mảng aray chứa n số tiếp theo
input = fopen("input.txt","rt"); // Mở file input
#include <stdio.h>
int main() {
int m, n, i;
int j = -1, k = -1;
printf("Input m, n, i: ");
scanf_s("%d%d%d", &m, &n, &i);
for (int x = 0; x <= m; x++)
for (int y = 0; y <= n; y++)
@duyet
duyet / SQL_Week_1.sql
Created September 17, 2014 09:04
SQL_Week_1
-- Init DB
CREATE DATABASE QuanLySieuThi;
USE QuanLySieuThi;
DROP TABLE KHACHHANG;
CREATE TABLE KHACHHANG (
MaKH char(4) PRIMARY KEY NOT NULL,
HoTen varchar(40) NOT NULL,
DChi varchar(50),
SoDt varchar(20),
CREATE DATABASE QLBH
-----------------------------------------------------
-----------------------------------------------------
---------------------------------------------
-- KHACHANG
CREATE TABLE KHACHHANG(
MAKH char(4) not null,
HOTEN varchar(40),
DCHI varchar(50),
SODT varchar(20),
lib =
fs : require('fs')
u : require('underscore')
https : require('https')
url : require('url')
appendToFile = (data) ->
lib.fs.open 'fbdata', 'a', (e, fd) ->
lib.fs.write fd, data, null, 'utf8', ->
lib.fs.close fd, ->
#include<stdio.h>
int width, height, pool, case_id = 0;
int field[103][103];
void rec(int x,int y) {
if (field[x][y]!=0) return;
field[x][y]=pool;
if (x<=height) rec(x+1,y);