Skip to content

Instantly share code, notes, and snippets.

@CrBoy
CrBoy / Makefile
Created November 28, 2010 17:28
For the first problem by pcyu
all: p1 p2
p1: p1.cpp
g++ -o p1 p1.cpp
p2: p2.cpp
g++ -o p2 p2.cpp
clean:
rm -f p1 p2
" filetypes
filetype plugin on
filetype indent on
" ~/.vimrc ends here
set laststatus=2
set statusline=%4*%<\ %1*[%F]
set statusline+=%4*\ %5*[%{&fileencoding}, " encoding
set statusline+=%{&fileformat}%{\"\".((exists(\"+bomb\")\ &&\ &bomb)?\",BOM\":\"\").\"\"}]%m
set statusline+=%4*%=\ %6*%y%4*\ %3*%l%4*,\ %3*%c%4*\ \<\ %2*%P%4*\ \>
This is a very coarse chatroom written by php. I made it in a speech just for chatting with 2 friends.
WARNING: This one is very dangerous, which would be attacked by command injecttion, please BE CAREFUL using it.
#include <cstdio> // printf
#include <cstdlib> // NULL
#include <algorithm> // fill
#include <vector>
#include <queue>
using namespace std;
//use constant instead of macro
const int MAXV = 1000; // maximum value of vertex
void gotoxy(int x, int y){
HANDLE hConsole = GetStdHandle( STD_OUTPUT_HANDLE );
COORD coord={x, y};
SetConsoleCursorPosition(hConsole, coord);
}
void setcolor(const char *fore, const char *back){
WORD type=0;
while(*fore!='\0'){
switch(*fore){