原创 單線程,多線程,線程池方法大文件指定單詞數量統計
import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.util.concurrent.CountDownLat
原创 hdoj 2035人見人愛A^B 解題報告
Problem Description 求A^B的最後三位數表示的整數。 說明:A^B的含義是“A的B次方” Input 輸入數據包含多個測試實例,每個實例佔一行,由兩個正整數A和B組成(1<=A,B<=10000),如果A=
原创 emplace與insert
c++中容器定義了很多操作。其中有6種操作: emplace_front,emplace,emplace_back; push_front,insert,push_back 都可以向容器中添加元素,但是其中又有很大的區別。
原创 struct Kernel_Thread* Get_Next_Runnable(void) { struct Kernel_Thread* best = 0; /* Find the
struct Kernel_Thread* Get_Next_Runnable(void) { struct Kernel_Thread* best = 0; /* Find the best thread from t
原创 uservm.c
int Load_User_Program(char *exeFileData, ulong_t exeFileLength, struct Exe_Format *exeFormat, con
原创 hdoj 2031進制轉換 解題報告
Problem Description 輸入一個十進制數N,將它轉換成R進制數輸出。 Input 輸入數據包含多個測試實例,每個測試實例包含兩個整數N(32位整數)和R(2<=R<=16, R<>10)。 Outpu
原创 hdoj 2034人見人愛A-B 解題報告
Problem Description 參加過上個月月賽的同學一定還記得其中的一個最簡單的題目,就是{A}+{B},那個題目求的是兩個集合的並集,今天我們這個A-B求的是兩個集合的差,就是做集合的減法運算。(當然,大家都知道集合的定
原创 c++容器下標賦值報錯
c++ 容器下像這樣進行下標賦值會報錯 #include<iostream> #include<vector> using namespace std; int main() { vector<int> q;
原创 hdoj 2033人見人愛A+B 解題報告
Problem Description HDOJ上面已經有10來道A+B的題目了,相信這些題目曾經是大家的最愛,希望今天的這個A+B能給大家帶來好運,也希望這個題目能喚起大家對ACM曾經的熱愛。 這個題目的A和B不是簡單的整數,而是兩
原创 32位校驗和
#include<iostream> #include<fstream> #include<string> using namespace std; ifstream in; int cheak_parity; int sum =
原创 hdoj 2032楊輝三角 解題報告
Problem Description 還記得中學時候學過的楊輝三角嗎?具體的定義這裏不再描述,你可以參考以下的圖形: 1 1 1 1 2 1 1 3 3 1 1 4 6 4 1 1 5 10 10 5 1 Input 輸入數據
原创 自用PV
int Semaphore_Destroy(int semID) { struct Kernel_Thread *current=g_currentThread; struct Semaphore *s; int i,j;
原创 Geekos userseg.c
/* * Segmentation-based user mode implementation * Copyright (c) 2001,2003 David H. Hovemeyer <[email protected]> *
原创 接收並解析ICMP報文
// paeseICMP.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include "paeseICMP.h"
原创 自用
#include <stdio.h> #include <string.h> #include <windows.h> #include <stdlib.h> #include <sys/types.h> #include <errno.