C++: expected `}' at end of input
代码如下:#include<iostream>#include<windows.h>#include<conio.h>#include<time.h>#include<s...
代码如下:
#include<iostream>
#include<windows.h>
#include<conio.h>
#include<time.h>
#include<string>
#include<fstream>
using namespace std;
int main()
{ int hls,hlg,hws,hwg,hl,hw;
ifstream in;
//ofstream out;
in.open("Data\\files.ini");
if(in.fail())
{cout<<"数据丢失!";
Sleep(1000);
exit(1);}
char data[20];
int size;
while(!in.eof())
{
in>>data;
if(strstr(data,"[length]="))
{
string n=strstr(data,"=");
hl=static_cast<int>(n[1])*10+static_cast<int>(n[2])-528;}
else if(strstr(data,"[width]="))
{
string n=strstr(data,"=");
hw=static_cast<int>(n[1])*10+static_cast<int>(n[2])-528;}
}/*
if((hw>39)||(hw<2)||(hl>79)||(hl<2))
{cout<<"数据错误!";
Sleep(1000);
exit(1);}*/
meau:
cout<<" 菜单";
/*cout<<" 长:";
if((hl>79)||(hl<2))
{cout<<"未指定";}
else
{cout<<hl;}
cout<<"宽:";
if((hw>39)||(hw<2))
{cout<<"未指定";}
else
{cout<<hw;}*/
cout<<endl<<"1:开始游戏"<<endl<<"2:打开存档"<<endl<<"3:设置"<<endl<<"4:退出游戏";
int key=0;
字数太多,不让我发完啊!!!
哦,不用了。return 0;后的括号不知道什么时候删了 展开
#include<iostream>
#include<windows.h>
#include<conio.h>
#include<time.h>
#include<string>
#include<fstream>
using namespace std;
int main()
{ int hls,hlg,hws,hwg,hl,hw;
ifstream in;
//ofstream out;
in.open("Data\\files.ini");
if(in.fail())
{cout<<"数据丢失!";
Sleep(1000);
exit(1);}
char data[20];
int size;
while(!in.eof())
{
in>>data;
if(strstr(data,"[length]="))
{
string n=strstr(data,"=");
hl=static_cast<int>(n[1])*10+static_cast<int>(n[2])-528;}
else if(strstr(data,"[width]="))
{
string n=strstr(data,"=");
hw=static_cast<int>(n[1])*10+static_cast<int>(n[2])-528;}
}/*
if((hw>39)||(hw<2)||(hl>79)||(hl<2))
{cout<<"数据错误!";
Sleep(1000);
exit(1);}*/
meau:
cout<<" 菜单";
/*cout<<" 长:";
if((hl>79)||(hl<2))
{cout<<"未指定";}
else
{cout<<hl;}
cout<<"宽:";
if((hw>39)||(hw<2))
{cout<<"未指定";}
else
{cout<<hw;}*/
cout<<endl<<"1:开始游戏"<<endl<<"2:打开存档"<<endl<<"3:设置"<<endl<<"4:退出游戏";
int key=0;
字数太多,不让我发完啊!!!
哦,不用了。return 0;后的括号不知道什么时候删了 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |