谁知道c++语言中棋子移动的问题的代码(请改进)

来源:百度知道 编辑:UC知道 时间:2024/05/15 10:10:30
//=========
//黑白棋子
//=========

#include <cstdlib>
#include <iostream>

using namespace std;
void diaohuan(char shuzhu[],int geshu );
int main(int argc, char *argv[])
{
int geshu,yd;
cout<<"请输入棋子(一种)的个数(4的倍数)):"<<endl;
cin>>geshu;
char shuzhu[geshu*2+2];
int in=0,in1=geshu;

for(int n=1;n<=geshu;n++)
{
cout<<" 0 ";
shuzhu[in]='0';
in++;
}
for(int n=1;n<=geshu;n++)
{
cout<<" * ";
shuzhu[in1]='*';
in1++;
}
for(int n=geshu*2;n<=geshu*2+2;n++)
shuzhu[n]='-';
cout<<"\n你想下棋吗?if you want to play chess,请输入0"<<endl;
cin>>yd;
if(yd!=0)
{

#include <cstdlib>
#include <iostream>

using namespace std;
void diaohuan(char shuzhu[],int geshu );
int main(int argc, char *argv[])
{
int geshu,yd;
cout<<"请输入棋子(一种)的个数(4的倍数)):"<<endl;
cin>>geshu;

char shuzhu[100];
int in=0,in1=geshu;

for(int n=1;n<=geshu;n++)
{
cout<<" 0 ";
shuzhu[in]='0';
in++;
}
for(n=1;n<=geshu;n++)
{
cout<<" * ";
shuzhu[in1]='*';
in1++;
}
for( n=geshu*2;n<=geshu*2+2;n++)
shuzhu[n]='-';
cout<<"\n你想下棋吗?if you want to play chess,请输入0"<<endl;
cin>>yd;
if(yd!=0)
{
cout<<"不会下就别捣乱!!"<<endl;
system("PAUSE");
return EXIT_SUCCESS;
}
else
{
cout<<"欢迎来梦幻棋门!"<<e