欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

C語言實(shí)現(xiàn)五子棋對戰(zhàn)系統(tǒng)

 更新時間:2022年05月06日 14:56:06   作者:連長少尉  
這篇文章主要為大家詳細(xì)介紹了C語言實(shí)現(xiàn)五子棋對戰(zhàn)系統(tǒng),文中示例代碼介紹的非常詳細(xì),具有一定的參考價值,感興趣的小伙伴們可以參考一下

本文實(shí)例為大家分享了C語言實(shí)現(xiàn)五子棋對戰(zhàn)的具體代碼,供大家參考,具體內(nèi)容如下

一直以來,有不少熱愛并希望學(xué)習(xí)五子棋的人,或者僅為了娛樂來下五子棋的人,他們一般通過下棋對戰(zhàn)來增加自己的對戰(zhàn)經(jīng)驗(yàn),而在現(xiàn)實(shí)生活由于五子棋布板麻煩,經(jīng)常缺少能下棋的環(huán)境,并且下棋時效率較低,記錄步數(shù)也較為麻煩。利用計(jì)算機(jī)來模擬下五子棋環(huán)境,只要有計(jì)算機(jī),就可以很方便的隨時隨地進(jìn)行下棋,并且對戰(zhàn)過程中對步數(shù)和下子過程進(jìn)行記錄,方便了喜歡下五子棋的人,讓他們的五子棋學(xué)習(xí)更加高效或者娛樂起來更加方便。

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <windows.h>
#include <conio.h>
?
char draw[32][60] = {{" "},
? ? {"[ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ]"},
? ? {" "},
? ? {"[ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ]"},
? ? {" "},
? ? {"[ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ]"},
? ? {" "},
? ? {"[ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ]"},
? ? {" "},
? ? {"[ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ]"},
? ? {" "},
? ? {"[ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ]"},
? ? {" "},
? ? {"[ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ]"},
? ? {" "},
? ? {"[ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ]"},
? ? {" "},
? ? {"[ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ]"},
? ? {" "},
? ? {"[ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ]"},
? ? {" "},
? ? {"[ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ]"},
? ? {" "},
? ? {"[ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ]"},
? ? {" "},
? ? {"[ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ]"},
? ? {" "},
? ? {"[ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ]"},
? ? {" "},
? ? {"[ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ]"},
};
?
typedef struct//坐標(biāo)結(jié)構(gòu)體
{
? ? int x;
? ? int y;
} node;
?
typedef struct//棧結(jié)構(gòu)體
{
? ? node data[120];
? ? int top;
} stack;
?
int win[3], player, step1, step2;
stack player1,player2;
?
char ch;
node pos;
?
int convY(int y);
int convX(int x);
void refreshDraw();
void BLUE();
void RED();
void GREEN();
void WHITE();
void printMap();
void printMenu();
void refreshMap();
void playerOperation(char cheese);
void jundge(int p, char cheese);
void in(char cheese);
void playerVsPlayer();
void playerVscomputer();
void gotoxy(int x, int y);
void printStep(int player, int step);
void askExit();
void printPos(int player, int x, int y);
void printRoad();
?
int main()
{
? ? char num[99];
? ? printMenu();
? ? while(1)
? ? {
? ? ? ? WHITE();
? ? ? ? refreshDraw();
? ? ? ? pos.x = 0;
? ? ? ? pos.y = 0;
? ? ? ? win[1] = 0;
? ? ? ? win[2] = 0;
? ? ? ? gets(num);
? ? ? ? if(strcmp(num, "1") == 0)
? ? ? ? {
? ? ? ? ? ? playerVsPlayer();
? ? ? ? ? ? system("cls");
? ? ? ? ? ? printMenu();
? ? ? ? }
? ? ? ? else if(strcmp(num, "2") == 0)
? ? ? ? {
? ? ? ? ? ? askExit();
? ? ? ? ? ? continue;
? ? ? ? }
? ? ? ? else
? ? ? ? {
? ? ? ? ? ? printf("請輸入正確數(shù)字!\n");
? ? ? ? }
? ? }
?
? ? return 0;
}
?
void BLUE()//字體變藍(lán)
{
? ? SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_BLUE|FOREGROUND_INTENSITY);
}
?
void RED()//字體變紅
{
? ? SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_RED|FOREGROUND_INTENSITY);
}
?
void GREEN()//字體變綠
{
? ? SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_GREEN|FOREGROUND_INTENSITY);
}
?
void WHITE()//字體變白
{
? ? SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_GREEN|FOREGROUND_RED|FOREGROUND_BLUE);
}
?
void printMap()//打印棋盤和棋子
{
? ? for(int i = 0; i <= 29; i++)
? ? {
? ? ? ? for(int j = 0; j <= 59; j++)
? ? ? ? {
? ? ? ? ? ? if(i==convX(pos.x) && (j==convY(pos.y)-1 || j==convY(pos.y)+1) )
? ? ? ? ? ? {
? ? ? ? ? ? ? ? if(player == 1)
? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? GREEN();
? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? else if(player == 2)
? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? RED();
? ? ? ? ? ? ? ? }
?
? ? ? ? ? ? }
? ? ? ? ? ? else if(draw[i][j] == '*')
? ? ? ? ? ? {
? ? ? ? ? ? ? ? RED();
? ? ? ? ? ? }
? ? ? ? ? ? else if(draw[i][j] == 'O')
? ? ? ? ? ? {
? ? ? ? ? ? ? ? GREEN();
? ? ? ? ? ? }
? ? ? ? ? ? printf("%c", draw[i][j]);
? ? ? ? ? ? WHITE();
? ? ? ? }
? ? ? ? printf("\n");
? ? }
}
?
void refreshDraw()//清空棋盤
{
? ? int i;
? ? for(i = 0; i <= 30; i=i+2)
? ? {
? ? ? ? strcpy(draw[i]," ");
? ? ? ? strcpy(draw[i+1],"[ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ]");
? ? }
? ? strcpy(draw[31]," ");
}
?
void printMenu()//打印菜單
{
? ? WHITE();
? ? printf("\n\n ? ? ****************************\n");
? ? printf(" ? ? * ? ? ? ? ? ? ? ? ? ? ? ? ?*\n");
? ? printf(" ? ? * ? ? ? ? 歡迎使用 ? ? ? ? *\n");
? ? printf(" ? ? * ? ?五子棋模擬對戰(zhàn)系統(tǒng) ? ?*\n");
? ? printf(" ? ? * ? ? ? ? ? ? ? ? ? ? ? ? ?*\n");
? ? printf(" ? ? ****************************\n\n\n");
? ? printf("\n【設(shè)計(jì)制作:by 軟件18-8邵蔚】\n\n");
? ? printf("游戲規(guī)則為:\n二人參與游玩,雙方分別使用兩種棋子,\n");
? ? printf("下在棋盤的 [ ] 上,\n");
? ? printf("先形成5子連線(斜線、豎線或橫線)的人獲勝。\n\n");
? ? printf("操作說明:\n玩家用鍵盤“W”“S”“A”“D”來選擇下棋位置,選擇好后,\n");
? ? printf("按“J”鍵來下棋,然后本回合結(jié)束,下一名玩家操作。\n\n");
? ? printf("輸入 1 并按回車開始游戲\n");
? ? printf("輸入 2 并按回車退出游戲\n");
}
?
int convY(int y)//將棋盤坐標(biāo)轉(zhuǎn)換為字符串?dāng)?shù)組下標(biāo)
{
? ? return 4*(y+8)-3;
}
?
int convX(int x)//將棋盤坐標(biāo)轉(zhuǎn)換為字符串?dāng)?shù)組下標(biāo)
{
? ? return 2*(8-x)-1;
}
?
void refreshMap()//刷新棋盤畫面
{
? ? gotoxy(0,0);
? ? printMap();
? ? gotoxy(0,0);
}
?
void playerOperation(char cheese)//掃描玩家輸入的 "W""A""S""D""J""K" , 并且在棋盤顯示或刪除棋子;
{
? ? while(1)
? ? {
? ? ? ? refreshMap();
? ? ? ? ch = getch();
? ? ? ? if(ch == 'a' && pos.y > -7)
? ? ? ? {
? ? ? ? ? ? pos.y--;
? ? ? ? }
? ? ? ? else if(ch == 'd' && pos.y < 7)
? ? ? ? {
? ? ? ? ? ? pos.y++;
? ? ? ? }
? ? ? ? else if(ch == 'w' && pos.x < 7)
? ? ? ? {
? ? ? ? ? ? pos.x++;
? ? ? ? }
? ? ? ? else if(ch == 's' && pos.x > -7)
? ? ? ? {
? ? ? ? ? ? pos.x--;
? ? ? ? }
? ? ? ? else if(ch == 'j' && draw[convX(pos.x)][convY(pos.y)] == ' ')
? ? ? ? {
? ? ? ? ? ? draw[convX(pos.x)][convY(pos.y)] = cheese;
? ? ? ? ? ? in(cheese);
? ? ? ? ? ? refreshMap();
? ? ? ? ? ? break;
? ? ? ? }
? ? ? ? else if(ch == 'k' && player1.top > 0)
? ? ? ? {
? ? ? ? ? ? int tx, ty;
? ? ? ? ? ? if(cheese == '*')
? ? ? ? ? ? {
? ? ? ? ? ? ? ? tx = player1.data[player1.top].x;
? ? ? ? ? ? ? ? ty = player1.data[player1.top].y;
? ? ? ? ? ? ? ? player1.top--;
?
? ? ? ? ? ? ? ? draw[convX(tx)][convY(ty)] = ' ';
? ? ? ? ? ? ? ? refreshMap();
? ? ? ? ? ? ? ? break;
? ? ? ? ? ? }
? ? ? ? ? ? else if(cheese == 'O')
? ? ? ? ? ? {
? ? ? ? ? ? ? ? tx = player2.data[player2.top].x;
? ? ? ? ? ? ? ? ty = player2.data[player2.top].y;
? ? ? ? ? ? ? ? player2.top--;
?
? ? ? ? ? ? }
? ? ? ? ? ? draw[convX(tx)][convY(ty)] = ' ';
? ? ? ? ? ? refreshMap();
? ? ? ? ? ? break;
? ? ? ? }
? ? ? ? else if(ch == 'k' && player1.top <= 0)
? ? ? ? {
? ? ? ? ? ? system("cls");
? ? ? ? ? ? printf("提示:沒有棋子了!\n");
? ? ? ? ? ? system("pause");
? ? ? ? ? ? refreshMap();
? ? ? ? ? ? printStep(1, step1);
? ? ? ? ? ? printStep(2, step2);
? ? ? ? ? ? gotoxy(65,16);
? ? ? ? ? ? printf(" 按 K 來悔棋。");
? ? ? ? ? ? gotoxy(65, 23);
? ? ? ? ? ? GREEN();
? ? ? ? ? ? printf("(玩家1 : O)");
? ? ? ? ? ? gotoxy(65, 24);
? ? ? ? ? ? RED();
? ? ? ? ? ? printf("(玩家1 : *)");
? ? ? ? }
? ? }
}
?
void jundge(int p, char cheese)//判斷是否有贏家
{
? ? int tx, ty, sum = 0;
?
? ? tx = pos.x;
? ? ty = pos.y;
? ? sum = 0;
? ? while(draw[convX(tx)][convY(ty)] == cheese && sum <= 5)
? ? {
? ? ? ? if(draw[convX(tx)][convY(ty)] == cheese)
? ? ? ? ? ? sum++;
? ? ? ? tx++;
? ? }
? ? tx = pos.x - 1;
? ? ty = pos.y;
? ? while(draw[convX(tx)][convY(ty)] == cheese && sum <= 5)
? ? {
? ? ? ? if(draw[convX(tx)][convY(ty)] == cheese)
? ? ? ? ? ? sum++;
? ? ? ? tx--;
? ? }
? ? if(sum >= 5)
? ? {
? ? ? ? win[p] = 1;
? ? ? ? return;
? ? }
//--------------------------------------------------------------------
? ? tx = pos.x;
? ? ty = pos.y;
? ? sum = 0;
? ? while(draw[convX(tx)][convY(ty)] == cheese && sum <= 5)
? ? {
? ? ? ? if(draw[convX(tx)][convY(ty)] == cheese)
? ? ? ? ? ? sum++;
? ? ? ? ty++;
? ? }
? ? tx = pos.x;
? ? ty = pos.y - 1;
? ? while(draw[convX(tx)][convY(ty)] == cheese && sum <= 5)
? ? {
? ? ? ? if(draw[convX(tx)][convY(ty)] == cheese)
? ? ? ? ? ? sum++;
? ? ? ? ty--;
? ? }
? ? if(sum >= 5)
? ? {
? ? ? ? win[p] = 1;
? ? ? ? return;
? ? }
//----------------------------------------------------------------------
? ? tx = pos.x;
? ? ty = pos.y;
? ? sum = 0;
? ? while(draw[convX(tx)][convY(ty)] == cheese && sum <= 5)
? ? {
? ? ? ? if(draw[convX(tx)][convY(ty)] == cheese)
? ? ? ? ? ? sum++;
? ? ? ? ty++;
? ? ? ? tx++;
? ? }
? ? tx = pos.x - 1;
? ? ty = pos.y - 1;
? ? while(draw[convX(tx)][convY(ty)] == cheese && sum <= 5)
? ? {
? ? ? ? if(draw[convX(tx)][convY(ty)] == cheese)
? ? ? ? ? ? sum++;
? ? ? ? ty--;
? ? ? ? tx--;
? ? }
? ? if(sum >= 5)
? ? {
? ? ? ? win[p] = 1;
? ? ? ? return;
? ? }
//----------------------------------------------------------------------
? ? tx = pos.x;
? ? ty = pos.y;
? ? sum = 0;
? ? while(draw[convX(tx)][convY(ty)] == cheese && sum <= 5)
? ? {
? ? ? ? if(draw[convX(tx)][convY(ty)] == cheese)
? ? ? ? ? ? sum++;
? ? ? ? tx--;
? ? ? ? ty++;
? ? }
? ? tx = pos.x + 1;
? ? ty = pos.y - 1;
? ? while(draw[convX(tx)][convY(ty)] == cheese && sum <= 5)
? ? {
? ? ? ? if(draw[convX(tx)][convY(ty)] == cheese)
? ? ? ? ? ? sum++;
? ? ? ? tx++;
? ? ? ? ty--;
? ? }
? ? if(sum >= 5)
? ? {
? ? ? ? win[p] = 1;
? ? ? ? return;
? ? }
?
? ? return;
}
?
void in(char cheese)//將棋子坐標(biāo)入棧
{
? ? if(cheese == '*')
? ? {
? ? ? ? player2.top++;
? ? ? ? player2.data[player2.top].x = pos.x;
? ? ? ? player2.data[player2.top].y = pos.y;
? ? }
? ? else if(cheese == 'O')
? ? {
? ? ? ? player1.top++;
? ? ? ? player1.data[player1.top].x = pos.x;
? ? ? ? player1.data[player1.top].y = pos.y;
? ? }
}
?
void playerVsPlayer()
{
? ? step1 = 0;
? ? step2 = 0;
? ? player1.top = 0;
? ? player2.top = 0;
? ? player1.data[0].x = -1;
? ? player1.data[0].y = -1;
? ? player2.data[0].x = -1;
? ? player2.data[0].y = -1;
? ? player = 2;
? ? printStep(1, step1);
? ? printStep(2, step2);
? ? gotoxy(65, 16);
? ? printf(" 按 K 來悔棋。");
? ? gotoxy(65, 17);
? ? printf(" 按 J 來下子。");
? ? gotoxy(65, 18);
? ? printf(" 按 W A S D 控制方向。");
? ? gotoxy(65, 23);
? ? GREEN();
? ? printf("(玩家1 : O)");
? ? gotoxy(65, 24);
? ? RED();
? ? printf("(玩家2 : *)");
? ? WHITE();
? ? while(win[1] == 0 && win[2] == 0)
? ? {
? ? ? ? int tx, ty;
? ? ? ? if(win[1] == 0 && win[2] == 0)
? ? ? ? {
? ? ? ? ? ? player = 1;
? ? ? ? ? ? playerOperation('O');
? ? ? ? ? ? if(ch == 'k' || ch == 'K')
? ? ? ? ? ? ? ? step2--;
? ? ? ? ? ? else
? ? ? ? ? ? ? ? step1++;
? ? ? ? ? ? tx = player1.data[player1.top].x;
? ? ? ? ? ? ty = player1.data[player1.top].y;
? ? ? ? ? ? printStep(1, step1);
? ? ? ? ? ? printStep(2, step2);
? ? ? ? ? ? printPos(1, tx, ty);
? ? ? ? }
? ? ? ? jundge(1,'O');
?
? ? ? ? if(win[1] == 0 && win[2] == 0)
? ? ? ? {
? ? ? ? ? ? player = 2;
? ? ? ? ? ? playerOperation('*');
? ? ? ? ? ? if(ch == 'k' || ch == 'K')
? ? ? ? ? ? ? ? step1--;
? ? ? ? ? ? else
? ? ? ? ? ? ? ? step2++;
? ? ? ? ? ? tx = player2.data[player2.top].x;
? ? ? ? ? ? ty = player2.data[player2.top].y;
? ? ? ? ? ? printStep(1, step1);
? ? ? ? ? ? printStep(2, step2);
? ? ? ? ? ? printPos(2, tx, ty);
? ? ? ? }
? ? ? ? jundge(2,'*');
? ? }
? ? if(win[1] == 1)
? ? {
? ? ? ? gotoxy(0,31);
? ? ? ? printf("【");
? ? ? ? GREEN();
? ? ? ? printf("玩家1");
? ? ? ? WHITE();
? ? ? ? printf("】 贏了 !\n");
? ? }
? ? else if(win[2] == 1)
? ? {
? ? ? ? gotoxy(0,31);
? ? ? ? printf("【");
? ? ? ? RED();
? ? ? ? printf("玩家2");
? ? ? ? WHITE();
? ? ? ? printf("】 贏了 !\n");
? ? }
? ? printf("按回車查看雙方下棋路線!\n");
? ? getchar();
? ? system("cls");
? ? if(win[1] == 1)
? ? {
? ? ? ? GREEN();
? ? ? ? printf("【玩家1】 贏了 !\n");
? ? }
? ? else if(win[2] == 1)
? ? {
? ? ? ? RED();
? ? ? ? printf("【玩家2】 贏了 !\n");
? ? }
? ? printRoad();
? ? getchar();
? ? return;
}
?
void askExit()//詢問退出
{
? ? char dis[20];
? ? system("cls");
? ? printf("確定退出?\n Y/N?\n");
? ? gets(dis);
? ? if(strcmp(dis, "y") == 0 || strcmp(dis, "Y") == 0)
? ? {
? ? ? ? system("cls");
? ? ? ? printf("感謝你的使用!\n");
? ? ? ? exit(0);
? ? }
? ? else
? ? {
? ? ? ? system("cls");
? ? ? ? printMenu();
? ? }
? ? return;
}
?
void gotoxy(int x, int y)//移動光標(biāo)函數(shù)
{
? ? COORD pos = {x,y};
? ? HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);
? ? SetConsoleCursorPosition(hOut, pos);
}
?
void printStep(int player, int step)//打印已走步數(shù)
{
?
? ? if(player == 1)
? ? {
? ? ? ? gotoxy(65,4);
? ? ? ? GREEN();
? ? ? ? printf("【玩家1】 :%02d", step);
? ? ? ? WHITE();
? ? }
? ? else if(player == 2)
? ? {
? ? ? ? gotoxy(65,6);
? ? ? ? RED();
? ? ? ? printf("【玩家2】 :%02d", step);
? ? ? ? WHITE();
? ? }
? ? return;
}
?
void printPos(int player, int x, int y)//打印下子坐標(biāo)
{
? ? if(player == 1)
? ? {
? ? ? ? gotoxy(65, 10);
? ? ? ? GREEN();
? ? ? ? if(x == -1 && y == -1)
? ? ? ? {
? ? ? ? ? ? printf(" ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?");
? ? ? ? }
? ? ? ? else
? ? ? ? {
? ? ? ? ? ? printf("玩家1下棋位置:第%d行,第%d列",8 + x, 8 + y);
? ? ? ? }
? ? ? ? WHITE();
? ? }
? ? else if(player == 2)
? ? {
? ? ? ? gotoxy(65, 10);
? ? ? ? RED();
? ? ? ? if(x == -1 && y == -1)
? ? ? ? {
? ? ? ? ? ? printf(" ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ");
? ? ? ? }
? ? ? ? else
? ? ? ? {
? ? ? ? ? ? printf("玩家2下棋位置:第%d行,第%d列",8 + x, 8 + y);
? ? ? ? }
? ? ? ? WHITE();
? ? }
?
? ? return;
}
?
void printRoad()//打印所有下子坐標(biāo)
{
? ? int i;
? ? GREEN();
? ? printf("玩家1的下棋路線為:\n");
? ? for(i = 1; i <= player1.top; i++)
? ? {
? ? ? ? printf("[ 第%d步 : (%d, %d) ] ? ", i, 8 + player1.data[i].x, 8 + player1.data[i].y);
? ? ? ? if(i % 5 == 0)
? ? ? ? ? ? printf("\n");
? ? }
? ? printf("\n");
?
? ? RED();
? ? printf("玩家2的下棋路線為:\n");
? ? for(i = 1; i <= player2.top; i++)
? ? {
? ? ? ? printf("[ 第%d步 : (%d, %d) ] ? ", i, 8 + player2.data[i].x, 8 + player2.data[i].y);
? ? ? ? if(i % 5 == 0)
? ? ? ? ? ? printf("\n");
? ? }
? ? printf("\n");
? ? WHITE();
? ? printf("輸入 E 結(jié)束查看并返回菜單!");
?
? ? while(1)
? ? {
? ? ? ? scanf("%c", &ch);
? ? ? ? if(ch == 'E' || ch == 'e')
? ? ? ? ? ? break;
? ? }
? ? return;
}

以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

最新評論