
请高手帮忙修改下这个C++程序 很急 谢谢 20
我用的是borlandc++我是新手写出来不能运行但又不知道问题出在哪能帮忙修改下可以让他运行吗谢谢#include<locale.h>#include<iostream...
我用的是borland c++ 我是新手 写出来不能运行 但又不知道问题出在哪能帮忙修改下可以让他运行吗 谢谢
#include <locale.h>
#include <iostream.h>
int main()
{ locale::global(locale("866"));
wstring str;
wcout<<L"请输入行:"<<endl;
getline(wcin,str);
int count=0;
for(wstring::const_iterator it=str.begin();it!=str.end();++it)
{
switch(*it)
{
case L'(':
++count;
break;
case L')':
--count;
break;
}
}
wcout<<L"左括号的数量 ";
if(count)
{
wcout<<L"在 "<<abs(count)<<(count>0?L" 多于":L" 小于");
wcout<<L" 右括号"; }
else wcout<<L"等于右括号的数量";
wcout<<endl;
system("PAUSE");
return 0;} 展开
#include <locale.h>
#include <iostream.h>
int main()
{ locale::global(locale("866"));
wstring str;
wcout<<L"请输入行:"<<endl;
getline(wcin,str);
int count=0;
for(wstring::const_iterator it=str.begin();it!=str.end();++it)
{
switch(*it)
{
case L'(':
++count;
break;
case L')':
--count;
break;
}
}
wcout<<L"左括号的数量 ";
if(count)
{
wcout<<L"在 "<<abs(count)<<(count>0?L" 多于":L" 小于");
wcout<<L" 右括号"; }
else wcout<<L"等于右括号的数量";
wcout<<endl;
system("PAUSE");
return 0;} 展开
展开全部
#include <locale.h>
#include <iostream.h>
改成
#include <locale>
#include <iostream>
using namespace std;
试试
#include <iostream.h>
改成
#include <locale>
#include <iostream>
using namespace std;
试试
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询