4.20信息日常

来源:互联网 发布:社交软件推荐算法 编辑:程序博客网 时间:2024/06/05 07:17

加减乘除 两数 计算

程序如下 :)

#include<iostream>
#include<string>       
using namespace std;
int main()
{
 int a,b,c;
 int inf=1<<31;
 char x;
 cin>>a>>x>>b;
 switch(x)
 {
  case '+':c=a+b;break;
  case '-':c=a-b;break;
  case '*':c=a*b;break;
  case '/':if (b!=0) c=a/b ; else c=inf;
 }
if(c!=inf) cout<<a<<x<<b<<"="<<c;
else cout<<"no";
 return 0;
}

em近期有一个问题:#include各个数据库都有什么区别呢????????好像初始设置的那么多库都没有什么特别的区别啊……【摊手】


0 0
原创粉丝点击