當前位置:首頁 » 操作系統 » hix源碼

hix源碼

發布時間: 2025-09-19 14:35:21

① 什麼是文件後綴

文件的後綴名,即文件的擴展名,是操作系統用來標志文件類型的一種機制,是一個類型的元數據。

舉例:「小說.txt」的文件名中,小說是主文件名,txt為擴展名(文本、外語全稱:Text),表示這個文件是一個純文本文件。

一個文件可以有或沒有擴展名。對於打開文件操作,沒有擴展名的文件需要選擇程序去打開它,有擴展名的文件會自動用設置好的程序去嘗試打開,文件擴展名是一個常規文件的構成部分,但一個文件並不一定需要一個擴展名。

(1)hix源碼擴展閱讀

常用的文件擴展名

1、doc/docx

表示:Word文檔,用微軟的word等軟體打開。

2、wps

表示:Wps文字編輯系統文檔,用金山公司的wps軟體打開。

3、xls/xlsx

表示:Excel電子表格,用微軟的excel軟體打開。

4、ppt/pptx

表示:Powerpoint演示文稿,用微軟的powerpoint等軟體打開。

5、rar

表示:WinRAR壓縮文件,用WinRAR等打開 。

6、pdf

表示:可移植文檔格式,用用pdf閱讀器打開(比如Acrobat)、用pdf編輯器編輯

7、dwg

表示:CAD圖形文件,用AutoCAD等軟體打開。

8、exe

表示:可執行文件、可執行應用程序,是Windows視窗操作系統。

② 跪求java五子棋源代碼

很sb的電腦五子棋:
import java.io.*;
import java.util.*;

public class Gobang {
// 定義一個二維數組來充當棋盤
private String[][] board;
// 定義棋盤的大小
private static int BOARD_SIZE = 15;

public void initBoard() {
// 初始化棋盤數組
board = new String[BOARD_SIZE][BOARD_SIZE];
// 把每個元素賦為"╋",用於在控制台畫出棋盤
for (int i = 0; i < BOARD_SIZE; i++) {
for (int j = 0; j < BOARD_SIZE; j++) {
// windows是一行一行來列印的。坐標值為(行值, 列值)
board[i][j] = "╋";
}
}
}

// 在控制台輸出棋盤的方法
public void printBoard() {
// 列印每個數組元素
for (int i = 0; i < BOARD_SIZE; i++) {
for (int j = 0; j < BOARD_SIZE; j++) {
// 列印數組元素後不換行
System.out.print(board[i][j]);
}
// 每列印完一行數組元素後輸出一個換行符
System.out.print("\n");
}
}

// 該方法處理電腦下棋:隨機生成2個整數,作為電腦下棋的坐標,賦給board數組。
private void compPlay() {
// 構造一個隨機數生成器
Random rnd = new Random();
// Random類的nextInt(int n))方法:隨機地生成並返回指定范圍中的一個 int 值,
// 即:在此隨機數生成器序列中 0(包括)和 n(不包括)之間均勻分布的一個int值。
int compXPos = rnd.nextInt(15);
int compYPos = rnd.nextInt(15);
// 保證電腦下的棋的坐標上不能已經有棋子(通過判斷對應數組元素只能是"╋"來確定)
while (board[compXPos][compYPos].equals("╋") == false) {
compXPos = rnd.nextInt(15);
compYPos = rnd.nextInt(15);
}
System.out.println(compXPos);
System.out.println(compYPos);
// 把對應的數組元素賦為"○"。
board[compXPos][compYPos] = "○";
}

// 該方法用於判斷勝負:進行四次循環掃描,判斷橫、豎、左斜、右斜是否有5個棋連在一起
private boolean judgeWin() {
// flag表示是否可以斷定贏/輸
boolean flag = false;
// joinEle:將每一個橫/豎/左斜/右斜行中的元素連接起來得到的一個字元串
String joinEle;
// 進行橫行掃描
for (int i = 0; i < BOARD_SIZE; i++) {
// 每掃描一行前,將joinEle清空
joinEle = "";
for (int j = 0; j < BOARD_SIZE; j++) {
joinEle += board[i][j];
}
// String類的contains方法:當且僅當該字元串包含指定的字元序列時,返回true。
if (joinEle.contains("●●●●●")) {
System.out.println("您贏啦!");
flag = true;
// 停止往下繼續執行,提前返回flag。
// 如果執行了這個return,就直接返回該方法的調用處;
// 不會再執行後面的任何語句,包括最後那個return語句。
// (而break僅僅是完全跳出這個for循環,還會繼續執行下面的for循環。)
return flag;
} else if (joinEle.contains("○○○○○")) {
System.out.println("您輸啦!");
flag = true;
// 提前返回flag
return flag;
}
}
// 進行豎行掃描
for (int i = 0; i < BOARD_SIZE; i++) {
joinEle = "";
for (int j = 0; j < BOARD_SIZE; j++) {
// 豎行的元素是它們的列值相同
joinEle += board[j][i];
}
if (joinEle.contains("●●●●●")) {
System.out.println("您贏啦!");
flag = true;
return flag;
} else if (joinEle.contains("○○○○○")) {
System.out.println("您輸啦!");
flag = true;
return flag;
}
}
// 進行左斜行掃描
for (int i = -(BOARD_SIZE - 2); i < BOARD_SIZE - 1; i++) {
joinEle = "";
for (int j = 0; j < BOARD_SIZE; j++) {
int line = i + j;
// 只截取坐標值沒有越界的點
if (line >= 0 && line < 15) {
joinEle += board[j][line];
}
}
if (joinEle.contains("●●●●●")) {
System.out.println("您贏啦!");
flag = true;
return flag;
} else if (joinEle.contains("○○○○○")) {
System.out.println("您輸啦!");
flag = true;
return flag;
}
}
// 進行右斜行掃描
for (int i = 1; i < 2 * (BOARD_SIZE - 1); i++) {
joinEle = "";
for (int j = 0; j < BOARD_SIZE; j++) {
int line = i - j;
if (line >= 0 && line < 15) {
joinEle += board[j][line];
}
}
if (joinEle.contains("●●●●●")) {
System.out.println("您贏啦!");
flag = true;
return flag;
} else if (joinEle.contains("○○○○○")) {
System.out.println("您輸啦!");
flag = true;
// 最後這個return可省略
}
}
// 確保該方法有返回值(如果上面條件都不滿足時)
return flag;
}

public static void main(String[] args) throws Exception, IOException {
Gobang gb = new Gobang();
gb.initBoard();
gb.printBoard();
// BufferedReader類:帶緩存的讀取器————從字元輸入流中讀取文本,並緩存字元。可用於高效讀取字元、數組和行。
// 最好用它來包裝所有其 read() 操作可能開銷很高的 Reader(如 FileReader 和 InputStreamReader)。
// 下面構造一個讀取器對象。
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
// 定義輸入字元串
String inputStr = null;
// br.readLine():每當在鍵盤上輸入一行內容按回車,剛輸入的內容將被br(讀取器對象)讀取到。
// BufferedReader類的readLine方法:讀取一個文本行。
// 初始狀態由於無任何輸入,br.readLine()會拋出異常。因而main方法要捕捉異常。
while ((inputStr = br.readLine()) != null) {
// 將用戶輸入的字元串以逗號(,)作為分隔符,分隔成2個字元串。
// String類的split方法,將會返回一個拆分後的字元串數組。
String[] posStrArr = inputStr.split(",");
// 將2個字元串轉換成用戶下棋的坐標
int xPos = Integer.parseInt(posStrArr[0]);
int yPos = Integer.parseInt(posStrArr[1]);
// 校驗用戶下棋坐標的有效性,只能是數字,不能超出棋盤范圍
if (xPos > 15 || xPos < 1 || yPos > 15 || yPos < 1) {
System.out.println("您下棋的坐標值應在1到15之間,請重新輸入!");
continue;
}
// 保證用戶下的棋的坐標上不能已經有棋子(通過判斷對應數組元素只能是"╋"來確定)
// String類的equals方法:比較字元串和指定對象是否相等。結果返回true或false。
if (gb.board[xPos - 1][yPos - 1].equals("╋")) {
// 把對應的數組元素賦為"●"。
gb.board[xPos - 1][yPos - 1] = "●";
} else {
System.out.println("您下棋的點已有棋子,請重新輸入!");
continue;
}
// 電腦下棋
gb.compPlay();
gb.printBoard();
// 每次下棋後,看是否可以斷定贏/輸了
if (gb.judgeWin() == false) {
System.out.println("請輸入您下棋的坐標,應以x,y的格式:");
} else {
// 完全跳出這個while循環,結束下棋
break;
}
}
}
}

③ 學生信息管理系統C++源代碼

#include<iostream>
#include<stdlib.h>
#include<string.h>
#include<malloc.h>
#define INIT_SIZE 10
#define INCRE_SIZE 10
#define SUBJECT_NUM 3
#define LEN 3

void show_Start();

void show_Table();

void addRecord();

void Info_delete();
void deleteRecord();
void delete_Num(int);
void delete_Name(char tarName[]);

void Info_modify();
void modifyRecord();
void modify_Num(int);
void modify_Name(char[]);

void Info_query();
void queryRecord();
void query_Num(int);
void query_Name(char[]);

void display();

void quit();

void menu_CMD();

char *subject[SUBJECT_NUM] = {"高代","數分","C語言"};

struct STUDENT
{
int num;
char name[20];
char sex;
float score[SUBJECT_NUM];
};

//struct STUDENT stu[LEN + 1];

//STUDENT *record = (STUDENT*)malloc(sizeof(STUDENT)*INIT_SIZE);

int static stuNum = 0;
//先暫時定義三個學生吧...

STUDENT *record = (STUDENT*)malloc(sizeof(STUDENT)*INIT_SIZE);;

int main()
{
//record = (STUDENT*)malloc(sizeof(STUDENT)*INIT_SIZE);
//STUDENT *record = (STUDENT*)malloc(sizeof(STUDENT)*INIT_SIZE);

/*
record[1].num = 1001;
strcpy(record[1].name,"Jason");
record[1].sex = 'M';
record[1].score[0] = 85.0;
record[1].score[1] = 90.0;
record[1].score[2] = 95.0;

record[2].num = 1002;
strcpy(record[2].name,"Jerry");
record[2].sex = 'M';
record[2].score[0] = 85.0;
record[2].score[1] = 90.0;
record[2].score[2] = 95.0;

record[3].num = 1003;
strcpy(record[3].name,"Jessie");
record[3].sex = 'F';
record[3].score[0] = 85.0;
record[3].score[1] = 90.0;
record[3].score[2] = 95.0;
*/

/*
Info_modify();
int key;
cout<<"請輸入您的選擇 : ";
cin>>key;

if(key == 1)
{
int targetNum;
cout<<"請輸入您欲修改的學生的學號 : ";
cin>>targetNum;

modify_Num(targetNum);
cout<<endl;

display();
}

if(key == 2)
{
char targetName[20];
cout<<"請輸入您欲修改學生的姓名 : ";
cin>>targetName;

modify_Name(targetName);
cout<<endl;

display();
}

if(key == 3)
{
exit(0);
}
*/

show_Start();

menu_CMD();

return 0;

}

//修改完後還應該顯示
void show_Start()
{
//cout<<endl;
cout<<" **************************************** "<<endl;
cout<<" 這是一個 "<<endl;
cout<<" 學生成績管理系統 "<<endl;
cout<<" 可以對學生成績進行管理 "<<endl;
cout<<" 歡迎大家使用 "<<endl;
cout<<" Made by Jason "<<endl;
cout<<" **************************************** "<<endl;
}

// 顯示表頭信息,即是 : 學號,姓名,性別,高代,數分,C語言.
void show_Table()
{
cout<<"學號"<<"\t"<<"姓名"<<"\t"<<"性別";
cout<<"\t"<<subject[0]<<"\t"<<subject[1]<<"\t"<<subject[2];
cout<<endl;
}

void menu_CMD()
{
int key;
while(1)
{
cout<<"1. 增加學生信息"<<endl;
cout<<"2. 刪除學生信息"<<endl;
cout<<"3. 修改學生信息"<<endl;
cout<<"4. 查詢學生信息"<<endl;
cout<<"5. 顯示學生信息"<<endl;
cout<<"6. 退出"<<endl;
cout<<"請輸入您的選擇 : ";
cin>>key;
while(1)
{
if((key < 1)||(key > 6))
{
int key;
cout<<"您的輸入有誤,請重新輸入!"<<endl;
cout<<"請選(1 - 5) : ";
cin>>key;
}
else
{
break;
}
}
switch(key)
{
case 1:
addRecord();
break;
case 2:
deleteRecord();
break;
case 3:
modifyRecord();
break;
case 4:
queryRecord();
break;
case 5:
display();
break;
case 6:
quit();
break;
}

}
}

///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////

//增加學生信息
void addRecord()
{

if(stuNum == 0)
{
cout<<"原來沒有記錄,現在建立新表!"<<endl;
stuNum++;
}
else
{
cout<<"現在在當前表的末尾添加新的信息!"<<endl;
stuNum++;
}

//如果數組空間不夠,重新申請空間
if(stuNum > INIT_SIZE)
{
cout<<"內存空間不夠,現在重新申請新的內存空間!"<<endl;
record = (STUDENT*)realloc(record,(INIT_SIZE + INCRE_SIZE)*sizeof(STUDENT));
cout<<"空間申請完成!"<<endl;
}

cout<<"您現在要添加一組新的信息,您確定嗎?"<<endl;
cout<<"請輸入您的選擇(Y/N) : ";
char choi;
cin>>choi;
if((choi == 'Y')||(choi == 'y'))
{
cout<<"請輸入學號 : ";
cin>>record[stuNum].num;
cout<<"請輸入姓名 : ";
cin>>record[stuNum].name;
cout<<"請輸入性別(M為男,F為女) : ";
cin>>record[stuNum].sex;

int i;
for(i = 0;i < SUBJECT_NUM;i++)
{
cout<<"請輸入"<<subject[i]<<"的成績 : ";
cin>>record[stuNum].score[i];
}
}

if((choi == 'N')||(choi == 'n'))
{
cout<<"退出添加新學生信息!"<<endl;
cout<<endl;
}

cout<<"現在已經有"<<stuNum<<"條學生的信息了!"<<endl;
cout<<endl;
}

//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//刪除信息 晚上完成...

//顯示deleteRecord的表頭信息
void Info_delete()
{
cout<<"請輸入刪除方式 : "<<endl;
cout<<"1. 按學號刪除"<<endl;
cout<<"2. 按姓名刪除"<<endl;
cout<<"3. 退出刪除"<<endl;
}

//刪除學生的信息,包含兩個子函數
void deleteRecord()
{
int key;
cout<<endl;
Info_delete();
cout<<"請輸入您的選擇 : ";
cin>>key;

if(key == 1)
{
int targetNum;
cout<<"請輸入您欲刪除學生的學號 : ";
cin>>targetNum;

//按學號刪除
delete_Num(targetNum);
cout<<endl;
}

if(key == 2)
{
char targetName[20];
cout<<"請輸入您欲刪除學生的姓名 : ";
cin>>targetName;

//按姓名刪除
delete_Name(targetName);
cout<<endl;
}

if(key == 3)
{
while(1)
{
menu_CMD();

}
}
}

//按學號刪除學生信息
//只用完成刪除操作,而不必輸出. 輸出的操作可以在主菜單中進行

void delete_Num(int tarNum)
{
int i;
for(i = 1;i <= stuNum;i++)
{
if(record[i].num == tarNum)
{
//刪除還要分兩種情況討論
//1. 欲刪除的學生信息是最後一位
//2. 欲刪除的學生信息不是最後一位

//第一種情況,欲刪除的學生是最後一位
if(i = stuNum)
{
cout<<"您所要刪除的學生信息是 : "<<endl;
show_Table();
cout<<record[i].num<<"\t"<<record[i].name<<"\t"<<record[i].sex<<"\t"
<<record[i].score[0]<<record[i].score[1]<<"\t"<<record[i].score[2];
cout<<endl;

cout<<endl<<"刪除後學生信息表為 : "<<endl;
show_Table();
for(int i = 1;i <= stuNum - 1;i++)
{
cout<<record[i].num<<"\t"<<record[i].name<<"\t"<<record[i].sex;
for(int j = 0;j < SUBJECT_NUM;j++)
{
cout<<"\t"<<record[i].score[j];
}
cout<<endl;
}
//顯示信息應該放在後面
/*
stuNum--;
cout<<"現在還剩下"<<stuNum<<"條學生的信息";
cout<<endl;
*/
}

//2.第二種情況,欲刪除的學生不是最後一位
if(i != stuNum)
{

cout<<"您所要刪除的學生信信息是 : "<<endl;
show_Table();
cout<<record[i].num<<"\t"<<record[i].name<<"\t"<<record[i].sex<<"\t"
<<record[i].score[0]<<"\t"<<record[i].score[1]<<"\t"<<record[i].score[2];

for(int j = i+1;j <= stuNum;j++)
{
record[j-1] = record[j];
}

//接著完成輸出

cout<<endl;
cout<<"刪除後學生信息表為 : "<<endl;
show_Table();
for(int i = 1;i <= stuNum-1;i++)
{
cout<<record[i].num<<"\t"<<record[i].name<<"\t"<<record[i].sex;
for(int j = 0;j < SUBJECT_NUM;j++)
{
cout<<"\t"<<record[i].score[j];
}
cout<<endl;
}
/*
stuNum--;
cout<<"現在還剩下"<<stuNum<<"條學生的信息";
cout<<endl;
*/
}

stuNum--;
cout<<"現在還是剩下"<<stuNum<<"條學生的信息";
cout<<endl;
}
}
}

/*

//方法同上
void delete_Name(char tarName[])
{
int i;
for(i = 1;i <= stuNum;i++)
{
if(strcmp(record[i].name,tarName) == 0)
{
//刪除還要分兩種情況討論
//1. 欲刪除的學生信息是最後一位
//2. 欲刪除的學生信息不是最後一位

//第一種情況 : 欲刪除學生是最後一位
if(i = stuNum)
{
cout<<"您所要刪除的學生信息是 : "<<endl;
show_Table();
cout<<record[i].num<<"\t"<<record[i].name<<"\t"<<record[i].sex<<"\t"
<<record[i].score[0]<<record[i].score[1]<<"\t"<<record[i].score[2];
cout<<endl;

cout<<endl<<"刪除後學生信息表為 : "<<endl;
show_Table();
for(int i = 1;i <= stuNum - 1;i++)
{
cout<<record[i].num<<"\t"<<record[i].name<<"\t"<<record[i].sex;
for(int j = 0;j < SUBJECT_NUM;j++)
{
cout<<"\t"<<record[i].score[j];
}
cout<<endl;
}
}

//第二種情況 : 欲刪除學生不是最後一位
if(i != stuNum)
{

cout<<"您所要刪除的學生信信息是 : "<<endl;
show_Table();
cout<<record[i].num<<"\t"<<record[i].name<<"\t"<<record[i].sex<<"\t"
<<record[i].score[0]<<"\t"<<record[i].score[1]<<"\t"<<record[i].score[2];

//整體往前 前移一位
for(int j = i+1;j <= stuNum;j++)
{
record[j-1] = record[j];
}
cout<<endl;

//接著完成輸出
cout<<"刪除後學生信息表為 : "<<endl;
show_Table();
for(int i = 1;i <= stuNum-1;i++)
{
cout<<record[i].num<<"\t"<<record[i].name<<"\t"<<record[i].sex;
for(int j = 0;j < SUBJECT_NUM;j++)
{
cout<<"\t"<<record[i].score[j];
}
cout<<endl;
}

cout<<endl;
}
}

}

}

*/

void delete_Name(char tarName[])
{
int i;
for(i = 1;i <= stuNum;i++)
{

//刪除還要分兩種情況討論
//1. 欲刪除的學生信息是最後一位
//2. 欲刪除的學生信息不是最後一位

//當欲刪除的學生是最後一位,直接輸出前面LEN-1位學生的信息

if(strcmp(record[i].name,tarName) == 0)
{
if(i == stuNum)
{
cout<<"您所要刪除的學生信息是 : "<<endl;
show_Table();
cout<<record[i].num<<"\t"<<record[i].name<<"\t"<<record[i].sex<<"\t"
<<record[i].score[0]<<"\t"<<record[i].score[1]<<"\t"<<record[i].score[2];

cout<<endl;

cout<<"刪除後學生信息表為 : "<<endl;
show_Table();
for(int i = 1;i <= stuNum-1;i++)
{
cout<<record[i].num<<"\t"<<record[i].name<<"\t"<<record[i].sex;
for(int j = 0;j < SUBJECT_NUM;j++)
{
cout<<"\t"<<record[i].score[j];
}
cout<<endl;
}
/*
stuNum--;
cout<<"現在還剩下"<<stuNum<<"條學生的信息";
cout<<endl;
*/
}

//當欲刪的學生不是最後一位,整體往前前移一位
if(i != stuNum)
{
cout<<"您所要刪除的學生信息是 : "<<endl;

show_Table();
cout<<record[i].num<<"\t"<<record[i].name<<"\t"<<record[i].sex<<"\t";
cout<<record[i].score[0]<<"\t"<<record[i].score[1]<<"\t"<<record[i].score[2];
cout<<endl;

//整體往前前移一位
for(int j = i+1;j <= stuNum;j++)
{
record[j-1] = record[j];
}

//然後輸出
cout<<endl;
cout<<"刪除後學生信息表為 : "<<endl;

show_Table();
for(int i = 1;i <= stuNum-1;i++)
{
cout<<record[i].num<<"\t"<<record[i].name<<"\t"<<record[i].sex;
for(int j = 0;j < SUBJECT_NUM;j++)
{
cout<<"\t"<<record[i].score[j];
}
cout<<endl;
}
/*
stuNum--;
cout<<"現在還剩下"<<stuNum<<"條學生的信息";
cout<<endl;
*/
}

stuNum--;
cout<<"現在還剩下"<<stuNum<<"條學生的信息";
cout<<endl;
}
}
}

/*****************************************************************************
******************************************************************************/

//顯示modifyRecord的表頭信息
void Info_modify()
{
cout<<"請輸入修改方式 : "<<endl;
cout<<"1. 按學號修改"<<endl;
cout<<"2. 按姓名修改"<<endl;
cout<<"3. 退出修改"<<endl;
}

//查詢學生的成績,當然裡麵包括兩個子函數
void modifyRecord()
{
int key;
cout<<endl;
Info_modify();
cout<<"請輸入您的選擇 : ";
cin>>key;

//按學號修改
if(key == 1)
{
int targetNum;
cout<<"請輸入您欲修改的學生的學號 : ";
cin>>targetNum;

modify_Num(targetNum);
cout<<endl;

//display();
}

//按姓名修改
if(key == 2)
{
char targetName[20];
cout<<"請輸入您欲修改學生的姓名 : ";
cin>>targetName;

modify_Name(targetName);
cout<<endl;

//display();
}

//退出修改
if(key == 3)
{
while(1)
{
menu_CMD();
}
}
}

//按學號修改
void modify_Num(int tarNum)
{
int i;
for(i = 1;i <= stuNum;i++)
{
if(record[i].num == tarNum)
{
cout<<endl<<"請修改該學生的信息"<<endl;
cout<<"請輸入該學生的學號 : ";
cin>>record[i].num;
cout<<"請輸入該學生的姓名 : ";
cin>>record[i].name;
cout<<"請輸入該學生的性別 : ";
cin>>record[i].sex;
cout<<"請輸入"<<subject[0]<<"的成績 : ";
cin>>record[i].score[0];
cout<<"請輸入"<<subject[1]<<"的成績 : ";
cin>>record[i].score[1];
cout<<"請輸入"<<subject[2]<<"的成績 : ";
cin>>record[i].score[2];
}
}
}

//按姓名修改
void modify_Name(char tarName[])
{
int i;
for(i = 1;i <= stuNum;i++)
{
if(strcmp(record[i].name,tarName) == 0)
{
cout<<endl<<"請修改該學生的信息 : "<<endl;
cout<<"請輸入該學生的學號 : ";
cin>>record[i].num;
cout<<"請輸入該學生的姓名 : ";
cin>>record[i].name;
cout<<"請輸入該學生的性別 : ";
cin>>record[i].sex;
cout<<"請輸入"<<subject[0]<<"的成績 : ";
cin>>record[i].score[0];
cout<<"請輸入"<<subject[1]<<"的成績 : ";
cin>>record[i].score[1];
cout<<"請輸入"<<subject[2]<<"的成績 : ";
cin>>record[i].score[2];
}
}
}

///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////

//顯示queryRecord的表頭信息
void Info_query()
{
cout<<"請輸入查詢方式 : "<<endl;
cout<<"1. 按學號查詢"<<endl;
cout<<"2. 按姓名查詢"<<endl;
cout<<"3. 退出查詢"<<endl;
}

//查詢學生信息queryRecord
void queryRecord()
{
int key;
cout<<endl;
Info_query();
cout<<"請輸入您的選擇 : ";
cin>>key;

if(key == 1)
{
int targetNum;
cout<<"請輸入您欲查詢學生的學號 : ";
cin>>targetNum;

query_Num(targetNum);
cout<<endl;
}

if(key == 2)
{
char targetName[20];
cout<<"請輸入您欲查詢學生的學號 : ";
cin>>targetName;

query_Name(targetName);
cout<<endl;
}

//退出查詢,退回到主菜單吧...
if(key == 3)
{
while(1)
{
menu_CMD();
}
}
}

//按學號查詢
void query_Num(int tarNum)
{
int i;
for(i = 1;i <= stuNum;i++)
{
if(record[i].num == tarNum)
{
//如果表中有該學生信息的話,僅用輸出該學生的信息即可.
//輸出該學生的信息
cout<<"該學生的信息如下 : "<<endl;

//顯示表頭信息
show_Table();

//顯示該學生具體的信息
cout<<record[i].num<<"\t"<<record[i].name<<"\t"<<record[i].sex;
cout<<"\t"<<record[i].score[0]<<"\t"<<record[i].score[1]<<"\t"<<record[i].score[2];
cout<<endl;
}
}
}

//按姓名查詢
void query_Name(char tarName[])
{
int i;
for(i = 1;i <= stuNum;i++)
{
if(strcmp(record[i].name,tarName) == 0)
{
cout<<"該學生的信息如下 : "<<endl;

show_Table();

cout<<record[i].num<<"\t"<<record[i].name<<"\t"<<record[i].sex;
cout<<"\t"<<record[i].score[0]<<"\t"<<record[i].score[1]<<"\t"<<record[i].score[2];
cout<<endl;
}
}
}

///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////

//先顯示所有學生的信息吧
//顯示record里所有學生的成績
void display()
{
show_Table();
int i,j;
for(i = 1;i <= stuNum;i++)
{
//cout<<"學號"<<"\t"<<"姓名"<<"\t"<<"性別";
cout<<record[i].num<<"\t"<<record[i].name<<"\t"<<record[i].sex;
for(j = 0;j < SUBJECT_NUM;j++)
{
cout<<"\t"<<record[i].score[j];
}
cout<<endl;
}
cout<<endl;
}

//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////

//退出
void quit()
{
char choi;
cout<<"您確定要退出嗎?"<<endl;
cout<<"請輸入您的選擇(Y/N) : ";
cin>>choi;
if((choi == 'Y')||(choi == 'y'))
{
cout<<"現在退出學生信息管理系統"<<endl;
exit(0);
}
//如果不是退出,則接著退回到主界面
else
{
cout<<endl;
menu_CMD();
}

}

這個是原創的... 在C-Free 4.0里跑過,可以正常運行
你可以試著跑一下,如果有什麼問題可以和我聯系

④ mplab x ide匯編配置位源代碼復制到哪裡

在講基於MPLAB X IDE 配置位配置前我先講講如何配置配置位。
比如PICLF1823的數據手冊 可以再器件配置中找到兩個寄存器。一個是配置字1 ,一個是配置字2.
對於初學者來說如此多的配置選項,該如何配置呢?我們要抓主重點。
配置字中最重要的配置選項就是:

看門狗配置 如:WDTE<1;0>; 一般選擇關閉看門狗
MCLRE復位腳的配置 如:MCLRE;一般選擇復位腳作I/O
震盪器的選擇: 如:FOSC<2:0>;根據實際情況配置,我這里一般選擇用 INTOSC 內部振盪器.
因為如果這三個沒有配置好的話程序根本無法運行。其他配置可以看數據手冊此不贅述。
MPLAB X IDE和MPLAB IDE 8不同。
MPLAB IDE 8 可以再界限中選擇配置位就行。配置選項可以不寫在代碼中。
MPLAB X IDE 如果要配置的話必須在代碼中寫出配置。
實例介紹:
1.打開MPLAB X IDE 在菜單欄中 點擊Window->PIC Memory Veiws->Configuration bits
2 在出現的Configuration Bits中的改變每個配置中的option選項,紅色的就是我們改變過的配置選項

3 配置完成後 點擊 Genarate Source Code to Output 產生配置源代碼。

將其中的 __CONFIG(FOSC_INTOSC & WDTE_OFF & PWRTE_ON & MCLRE_OFF & CP_ON & CPD_ON & BOREN_ON & CLKOUTEN_OFF & IESO_ON & FCMEN_ON);
__CONFIG(WRT_OFF & PLLEN_OFF & STVREN_ON & BORV_LO & LVP_OFF);復制到源代碼中去。源代碼中必須包涵頭文件#include<pic.h>.

此處我指出一出MPLAB X IDEv1.10 的一處錯誤 在配置中的 BORV_LO 這個配置編譯器是不認的,這可能是編寫軟體的程序員和編寫頭文件的程序猿沒有配合好:
編譯器只認得頭文件,在pic16f1823.h這個頭文件中沒有定義BORV_LO 而是把他定義為BORV_19.把BORV_HI定義成BORV_25. 總之把BORV_LO修改成BORV_19就行了。
下面應網友的要求對16F877A的配置位進行講解:
CP :程序區保護 該位置1將開啟 。(這個位是必須開啟的以防止程序被讀取)
DEBUG: 使能調試功能。如果不使能RB6 RB7腳作為普通的I/O口(根據需求)
WRT1:WRT0:防寫位。防止程序區被意外寫入。(一般建議開啟)
CPD:EEPROM保護,(這個位必須開啟以防止EEPROM中的數據被讀取)
LVP:低電壓編程使能位。如果不使用低電壓編程 RB3將做普通I/O.MCLR必須用於編程。(根據需求)
BOREN:掉電檢測。掉電檢測的作用是單片機發現電壓不足的時候會及時的停止工作。防止一些意外操作的發生。比如 EEPROM 或者FLASH中的數據丟失(這個一般必須開啟防止丟碼)
PWRTEN:上電延時。開啟後單片機會延時72MS開始工作。保證上電後電路穩定後單片機才開始工作。不要求單片機一上電就馬上工作,這個位建議開啟。(建議開啟)
WDTEN:看門狗。 這個位根據你自己需要吧。開啟之後程序必須 不停的喂狗。喂不好程序就會復位。(根據需求)
FOSC1:FOSC0:振盪器選擇位。如果你用高速的就選擇HS.中速度的就用XT,希望速度低功耗低就用LP。希望用便宜且對精度要求不高的振盪器就用RC。(根據需求選擇)
20MHz~4MHz (包括4MHz)的石英晶振配置HS.
4MHz(包括4MHz)~200KHz(包括200KHz) 的石英晶振配置XT.

200KHz(包括200KHz)~32KHz的石英晶振配置LP.
RC 就是 電阻加電容。就可以做出一個便宜但精度不高的是振盪器了。

⑤ 遊程編碼源代碼

這個...........樓上的諸位說的都是什麼啊。今天剛好看到這個問題,把你的E-mail給我把,我有純c的源碼(RLC)。

算了,直接貼關鍵部分吧。這個有一點C++成分,很容易改的。
bool CompressRunLength(BYTE *pSrc, int nSrcLen, BYTE *&pDes, int &nDesLen, int nBitsPerSample, void* nRuns, int nRunCount, int nRunSize);
bool DecompressRunLength(BYTE *pSrc, int nSrcLen, BYTE *&pDes, int &nDesLen);

#define GetDWORD(buf,bit,mask) ((*(DWORD*)(((BYTE*)buf)+((bit)>>3)))>>((bit)&7)&(mask))
#define GetWORD(buf,bit,mask) ((*(WORD*)(((BYTE*)buf)+((bit)>>3)))>>((bit)&7)&(mask))

int GetBitCount(int n)
{
int nBitCount = 0;
while(n)
n >>= 1, nBitCount++;
return nBitCount;
}

int BinarySearch(void* pValue, int nVlaueSize, void* pArray, int nCount)
{
int nIndex, nResult, nStart = 0, nEnd = nCount-1;
while(nStart <= nEnd)
{
nIndex = (nEnd+nStart)/2;
if((nResult = memcmp((BYTE*)pArray+nIndex*nVlaueSize, pValue, nVlaueSize)) == 0)
return nIndex;
if(nResult > 0)
nEnd = nIndex-1;
else
nStart = nIndex+1;
}
return -1;
}

bool CompressRunLength(BYTE *pSrc, int nSrcLen, BYTE *&pDes, int &nDesLen, int nBitsPerSample, void* nRuns, int nRunCount, int nRunSize)
{
pDes = (BYTE*)malloc(nSrcLen*2);
memset(pDes, 0, nSrcLen*2);

nDesLen = sizeof(DWORD);
*(DWORD*)pDes = nSrcLen; // save source length
*(pDes+nDesLen++) = nBitsPerSample; // save bits per sample
*(pDes+nDesLen++) = nRunCount; // save runs count
*(pDes+nDesLen++) = nRunSize; // save run bytes
memcpy(pDes+nDesLen, nRuns, nRunCount*nRunSize); // save runs
nDesLen += nRunCount*nRunSize;
nDesLen <<= 3; // bytes to bits
if(nRunCount == 0)
nRunCount = 256, nRunSize = 1, nRuns = NULL;

int nBitsPerTypeIndex = GetBitCount(nRunCount-1);
int nMaxRunLength = (1 << nBitsPerSample)-1, nRunLength, nRunIndex, nByte = 0;
// loop in the source buffer
while(nByte < nSrcLen)
if((nRuns && (nRunIndex = BinarySearch(pSrc+nByte, nRunSize, nRuns, nRunCount)) != -1 &&
memcmp(pSrc+nByte+nRunSize, (BYTE*)nRuns+nRunIndex*nRunSize, nRunSize) == 0) ||
(!nRuns && (nRunIndex = *(pSrc+nByte)) == *(pSrc+nByte+1)))
{ // set bit to 1 to indicate type found
*(pDes+(nDesLen>>3)) |= 1 << (nDesLen&7);
*(DWORD*)(pDes+(++nDesLen>>3)) |= nRunIndex << (nDesLen&7);
nDesLen += nBitsPerTypeIndex;
// skip the two repeated runs
nByte += nRunSize*2;
// get run length - 2 (without the two repeated runs)
nRunLength = 0;
while(nRunLength < nMaxRunLength && nByte < nSrcLen &&
((nRuns && memcmp(pSrc+nByte, (BYTE*)nRuns+nRunIndex*nRunSize, nRunSize) == 0) || (!nRuns && (BYTE)nRunIndex == *(pSrc+nByte))))
nRunLength++, nByte += nRunSize;
// save run length and increment destination length by bits per sample
*(DWORD*)(pDes+(nDesLen>>3)) |= nRunLength << (nDesLen&7);
nDesLen += nBitsPerSample;
}
else // one byte
*(WORD*)(pDes+(++nDesLen>>3)) |= *(pSrc+nByte++) << (nDesLen&7), nDesLen += 8;
nDesLen = (nDesLen+7)/8; // bits to bytes
pDes = (BYTE*)realloc(pDes, nDesLen);

return true;
}

bool DecompressRunLength(BYTE *pSrc, int nSrcLen, BYTE *&pDes, int &nDesLen)
{
if(nSrcLen == 0)
return true;

// allocate destination buffer
nDesLen = *(DWORD*)pSrc;
pDes = (BYTE*)malloc(nDesLen);
memset(pDes, 0, nDesLen);

// compression information
int nSrcIndex = sizeof(DWORD);
int nBitsPerSample = *(pSrc+nSrcIndex++);
int nRunCount = *(pSrc+nSrcIndex++);
int nRunSize = *(pSrc+nSrcIndex++);
void* nRuns = pSrc+nSrcIndex;
nSrcIndex += nRunSize*nRunCount;
nSrcIndex <<= 3; // bytes to bits
if(nRunCount == 0)
nRunCount = 256, nRunSize = 1, nRuns = NULL;

int nBitsPerTypeIndex = GetBitCount(nRunCount-1);
int nMaxTypeIndex = (1 << nBitsPerTypeIndex)-1;
int nMaxRunLength = (1 << nBitsPerSample)-1;
int nDesIndex = 0, nRunLength, nRunIndex, nRun, nByte;

nSrcLen <<= 3; // bytes to bits
while(nSrcIndex < nSrcLen-8)
if((*(pSrc+(nSrcIndex>>3)) >> (nSrcIndex++&7)) & 1)
{
nRunIndex = GetDWORD(pSrc, nSrcIndex, nMaxTypeIndex), nSrcIndex += nBitsPerTypeIndex;
nRunLength = GetDWORD(pSrc, nSrcIndex, nMaxRunLength)+2, nSrcIndex += nBitsPerSample;
for(nRun = 0; nRun < nRunLength; nRun++)
for(nByte = 0; nByte < nRunSize; nByte++, nDesIndex += 8)
*(WORD*)(pDes+(nDesIndex>>3)) |= nRuns ? GetWORD(nRuns+nRunSize*nRunIndex, nByte<<3, 0xff) : (BYTE)nRunIndex;
}
else // one byte
*(WORD*)(pDes+(nDesIndex>>3)) |= GetWORD(pSrc, nSrcIndex, 0xff), nDesIndex += 8, nSrcIndex += 8;

return true;
}

⑥ 剛注冊了個網站,然後又注冊了個虛擬機,然後下了個江湖聊天室的ASP源碼包,我將這個文件直接通過FTP上傳

1、先解壓
2、上傳棚檔猛謹
3、看下說明文件,一般的建站程序都需要安裝的。
安裝文件一般是install.asp或者是setup.asp,自鏈知亂己找下就可以了。

熱點內容
鳥保護腳本 發布:2025-09-19 15:25:46 瀏覽:54
家庭舊電腦改伺服器實用嗎 發布:2025-09-19 15:04:14 瀏覽:160
java查詢sql 發布:2025-09-19 14:55:30 瀏覽:839
surfacelinux 發布:2025-09-19 14:55:30 瀏覽:316
hix源碼 發布:2025-09-19 14:35:21 瀏覽:70
空調壓縮機格力 發布:2025-09-19 14:32:10 瀏覽:567
伺服器地址號段 發布:2025-09-19 14:21:32 瀏覽:720
安卓系統注冊的游戲怎麼轉到蘋果 發布:2025-09-19 14:18:50 瀏覽:466
無限寶緩存 發布:2025-09-19 13:35:59 瀏覽:99
linuxzip分卷解壓 發布:2025-09-19 13:29:24 瀏覽:342