Skip to content

Instantly share code, notes, and snippets.

View SilverRainZ's full-sized avatar

Shengyu Zhang SilverRainZ

View GitHub Profile
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
using namespace std;
typedef struct
{
int x;
int y;
}TPoint;
#include<cstdio>
#include<cstring>
bool pr[110];
void init()
{
int i,j;
memset(pr,true,sizeof(pr));
pr[0]=pr[1]=false;
#include <stdio.h>
#include <string.h>
#include <math.h>
int main()
{
int prime[100];
for (int i = 10; i <= 99; i++)
{
int f = 1;
for (int j = 2; j <= sqrt(i); j++)
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#define z0(x) memset(x, 0, sizeof(x))
#define z1(x) memset(x, -1, sizeof(x))
#define N 150010
using namespace std;
typedef struct star{
#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
const int MAXN = 32005;
int c[MAXN],level[MAXN],n;
int lowbit(int x){return x & (-x);}
@SilverRainZ
SilverRainZ / HMT.cpp
Last active August 29, 2015 14:10
HMT Happy Birthday.
#include <stdio.h>
#include <stdlib.h>
#define _c '*'
#define _s ' '
#define _n '\n'
#define ____ &
#define _______ putchar
const int _____ = 8;
#define ___ for (int __ = 0; __ < _____; __++)
#define ______(a,b,c) if a b; else c;
@SilverRainZ
SilverRainZ / gist:34162a75b400139517a2
Last active August 29, 2015 14:10
HMT Happy Birthday.
#include <stdio.h>
#include <stdlib.h>
#define _c '*'
#define _s ' '
#define _n '\n'
#define ____ &
#define _______ putchar
const int _____ = 8;
#define ___ for (int __ = 0; __ < _____; __++)
#define ______(a,b,c) if a b; else c;
Here are some message about my gdt,idt, tss and page table.
=======TSS==========
tr:s=0x2b, base=0x00000000005d4040, valid=1
ss:esp(0): 0x0010:0x1ffeff9c
ss:esp(1): 0x0000:0x00000000
ss:esp(2): 0x0000:0x00000000
cr3: 0x00000000
eip: 0x00000000
eflags: 0x00000000
// printl.c
#ifdef DEBUG
inline void printl(const char *fmt, ...){ \
char buf[256]; \
va_list args; \
int i; \
\
memset(buf, 0, sizeof(buf)); \
va_start(args, fmt); \
vsprintk(buf, fmt, args); \
function.cpp:
- void Initialize(p)
+ void Initialize()
main.cpp
- Initialize(p);
- Initialize();