怎样改才能在输入y时继续进行计算?输入n时跳出循环?
#include<iostream>using namespace std;
main()
{
int x,y;
char a,h,Y,N,n;
cout<<"请输入两个数字和需要的运算符号"<<endl;
cin>>x>>a>>y;
switch(a)
{
case '+': cout<<(x+y)<<endl;cout<<"是否继续输入?"<<endl;cin>>h;if(h==n||N)break;
case '-': cout<<(x-y)<<endl;cout<<"是否继续输入?"<<endl;cin>>h;if(h==y||Y)break;
case '*': cout<<(x*y)<<endl;cout<<"是否继续输入?"<<endl;cin>>h;if(h==y||Y)break;
case '/': cout<<(x/y)<<endl;cout<<"是否继续输入?"<<endl;cin>>h;if(h==y||Y)break;
default: cout<<"输入错误"<<endl;break;
}
}