c++-能帮忙修改下吗 C++ 我是初学者

问题描述

能帮忙修改下吗 C++ 我是初学者
#include
#include
#include
#include
using namespace std;
void welcome();
void explain();
int assignment();
char display(char* board);
char judge(char* board);
bool legal(int line int columnchar* board);
void bye();
char enter(char* board);
const char X='X';
const char N='N';
int main()
{
int line=7column=4;
char board
welcome();
explain();
int i=0j;
for(i=0;i<7;i++){
for(j=0;j<4;j++)
cout<< (assignment()+i)[j]<<endl;
}

display(&board);
enter(&board);
while(judge(&board)==N)
{
cout<<""enter againsir!""<<endl;
enter(&board);
display(&board);

}
bye();
system(""pause"");
return 0;
}
void wlcome()
{
cout<<""Welcome to flight booking platform I am Weiwei! Glad to be of service.""<<endl;
}
void explain()
{
cout<<""Let me teach you how to book a table in the next""<<endl;
cout<<""We will show an interface""<<endl;
cout<<""As long as the above no X can I make a reservation And booking your input(line and column)""<<endl;
cout<<""Now we will pop-up book interface!""<<endl;
cout<<""1 A B CDn"";
cout<<""2 A B CDn"";
cout<<""3 A B CDn"";
cout<<""4 A B CDn"";
cout<<""5 A B CDn"";
cout<<""6 A B CDn"";
cout<<""7 A B CDn"";
}
int *assignment()
{
int line=7column=4;
char board[line][column]={ {ABCD}
(ABCD)
{ABCD}
{ABCD}
{ABCD}
{ABCD}
{ABCD}};
return board[0];

}
inline bool legal(int line int columnchar* board)
{
return(board[line][column]!=X);

}
char enter(char* board)
{
int linecolumn;
cout<<""Enter a line""< cin>>line;
cout<<""Enter a column""< cin>>column;
while(!legal(linecolumnboard))
{
cout<<""nSorry sirit's defaulyplease enter againn"";
enter(&board);
}
board[line][column]=X;
}
char display(char* board)
{
cout<<""nt""<<board[0][0]<<"" ""<<boaed[0][1]<<"" ""<<board[0][2]<<"" ""<<board[0][3];
cout<<""nt""<<board[1][0]<<"" ""<<boaed[1][1]<<"" ""<<board[1][2]<<"" ""<<board[1][3];
cout<<""nt""<<board[2][0]<<"" ""<<boaed[2][1]<<"" ""<<board[2][2]<<"" ""<<board[2][3];
cout<<""nt""<<board[3][0]<<"" ""<<boaed[3][1]<<"" ""<<board[3][2]<<"" ""<<board[3][3];
cout<<""nt""<<board[4][0]<<"" ""<<boaed[4][1]<<"" ""<<board[4][2]<<"" ""<<board[4][3];
cout<<""nt""<<board[5][0]<<"" ""<<boaed[5][1]<<"" ""<<board[5][2]<<"" ""<<board[5][3];
cout<<""nt""<<board[6][0]<<"" ""<<boaed[6][1]<<"" ""<<board[6][2]<<"" ""<<board[6][3];
cout<<""nn"";
}
char judge(char* board)
{
int linecolumn;
for(line=0;line<7;line++)
for(column=0;column<4;column++)
if(board[line][column]!=X)
{
cout<<""You can also book again""<<endl;
return N;
}

       else         cout<<""The shipping space is fullI'm sorry!""<<endl;     

}
void bye()
{
cout<<""I'm glad to serve you this time looking forward to your coming next timebyebye!""<<endl;
}

解决方案

#include <>
头文件肿么可以那样写

解决方案二:
你想怎么改啊?说一下要求啊

解决方案三:
你的意思使用C++实现上面的功能么?
我说说我的思路:
首先有一个座位的类,里面包含的成员有,座位的排数,列数,以及状态(X,A,B,C,D...);
然后有一个飞机的类,里面包含总共有多少行多少列(就是有多少个位置),成员函数有状态的初始化,显示,设置,查询等功能;

解决方案四:
你的意思使用C++实现上面的功能么?
我说说我的思路:
首先有一个座位的类,里面包含的成员有,座位的排数,列数,以及状态(X,A,B,C,D...);
然后有一个飞机的类,里面包含总共有多少行多少列(就是有多少个位置),成员函数有状态的初始化,显示,设置,查询等功能;

解决方案五:
楼主重新改写一下内容的格式吧。。。代码的话用用两个'```'包装起来

时间: 2024-09-16 03:59:34

c++-能帮忙修改下吗 C++ 我是初学者的相关文章

java-小白求助,求大神帮忙修改下代码

问题描述 小白求助,求大神帮忙修改下代码 我的条件是condition=1|2|3|4|5.... if (source.getProperty(""condition"" + NUM).equals(""1"")) { return p.panduan1(readrow source); } else if (source.getProperty(""condition"" + NUM

麻烦帮忙修改下这个管理系统的错误!一直有两个错误,急死了!

问题描述 麻烦帮忙修改下这个管理系统的错误!一直有两个错误,急死了!谢谢各位大大了由于无法上传附件,附上管理系统链接http://www.shubulo.com/thread-40674-1-1.html 解决方案 解决方案二:一直提示frmSite为未定义类型....解决方案三:都没有这个frmsite的窗体,你再定义一百次也没有用~

帮忙修改下,编译说是找不到找不到init方法里InputPanel,UpdatePanel,SearchPanel,DeletePanel的符号

问题描述 importjava.awt.*;importjava.applet.*;importjava.awt.event.*;//主界面publicclassStudentSystemextendsFrameimplementsActionListener{PanelMainPanel,InputPanel,UpdatePanel,SearchPanel,DeletePanel,p1,p2,p3,p4,p5,p6,p7;Framef1=newFrame("录入对话框");Frame

verilog程序-帮忙修改一下这个Verilog程序,关于两个源驱动同一个输出

问题描述 帮忙修改一下这个Verilog程序,关于两个源驱动同一个输出 要实现oe发生跳变时,这个输出置0,当定时时间到来时这个输出置1: 一下这个程序,帮忙修改下: module Timer ( input rst, input oe, input clk, output TI_flag ); parameter Ttime=100 ;//定时时间 wire flag; //定时器溢出标志位 reg [31:0] count; assign (supply1 ,weak0)flag= (oe

语言-新手求帮忙看下这段代码的数据溢出问题,没有C币理解下(我是在CodeBlock10.05下运行的)

问题描述 新手求帮忙看下这段代码的数据溢出问题,没有C币理解下(我是在CodeBlock10.05下运行的) #include #include #include unsigned int Ex_secret[30]={11,4,120,75,170,204,90,59,78,49,//用0~255的数表示8位2进制,一共240位 148,248,190,137,0,9,17,91,174,105,45,124,177,205,57,97,194,155,120,36}; unsigned in

c++-帮忙看下代码,运行不了了,哪里有问题麻烦指出来下谢谢~!麻烦修改下 谢谢!

问题描述 帮忙看下代码,运行不了了,哪里有问题麻烦指出来下谢谢~!麻烦修改下 谢谢! #include #include using namespace std; int min(int n, int m); int max(int n, int m); const int N = 50; void Read_Store(int Number[N], int &length); void Add_Output(); int main() { cout<<" This is a

服务器-求各位大神帮忙 急急急... 点击事件直接不执行了 告诉我怎么修改下

问题描述 求各位大神帮忙 急急急... 点击事件直接不执行了 告诉我怎么修改下 /* 上拉加载 */ public class queren extends Activity implements IXListViewListener{ public Context context; public TelephonyManager telephonyManager; public String deviceId; private static String url ="http://www.yi

DotNetTextBox 在修改内容后 后台有点问题 各位帮忙看下哪里有问题

问题描述 <DNTB:WebEditorID="WebEditorInfo"runat="server"Width="72%"Height="500px"LeftAreaAlign="center"LeftAreaWidth="25%"RightAreaWidth="75%"/>后台赋值WebEditorInfo.text=数据库中字段内容可以正常显示显示

vs2010-VS2010中的工具栏设置出问题了,谁能帮忙解决下?

问题描述 VS2010中的工具栏设置出问题了,谁能帮忙解决下? 我用VS2010创建了一个单文档程序,然后我想把工具栏中的按钮的图标改成自定义的bmp位图: 结果编译出来是这个样子的: 这该怎么解决? 我改图标的方法是:右键点任意一个工具栏的图标,选择"打开外部编辑器",直接改成我事先设置好的bmp位图再保存.图标大小已经改成32*32的了,bmp文件中也是按照这个大小来画的.我是在IDR_MAINFRAME资源里改的. MainFrm.cpp文件中OnCreate函数的原始代码我改了