标签:style blog color os io ar div log
?#include<iostream> using namespace std; int main() { int x,y; char a; cout<<"please input two numbers: "<<endl; cin>>x>>y; cout<<"please input an operational character:"<<endl; cin>>a; switch(a)//switch函数的参数还可用字符 { case ‘+‘: cout<<"x+y="<<x+y;break; case ‘-‘: cout<<"x-y="<<x-y;break; case ‘*‘: cout<<"x*y="<<x*y;break; case ‘/‘: cout<<"x/y="<<x/y;break; default : break; } return 0; }
51.从键盘上输入任意两个数和一个运算符(+、-、*、/),根据输入的运算符对两个数计算,并输出结果,布布扣,bubuko.com
51.从键盘上输入任意两个数和一个运算符(+、-、*、/),根据输入的运算符对两个数计算,并输出结果
标签:style blog color os io ar div log
原文地址:http://www.cnblogs.com/jixiaowu/p/3901156.html