4 条题解

  • 2
    @ 2023-6-20 16:51:14
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
    	char b;
    	int x,a; 
    	cin>>x>>a>>b;
    	if(b=='+') {
    	cout<<x+a;
    	} else if(b=='-') {
    	cout<<x-a;
    	} if(b=='/') {
    	cout<<x/a;
    	}if(b=='*') {
    	cout<<x*a;
    	}  
    	 
    	return 0;
    }
    
    • -2
      @ 2023-5-31 16:55:31

      #include<iostream> using namespace std; int main() { int a,b; char c; cin>>a>>b>>c; if(c=='+') { cout<<a+b; } else if(c=='-') { cout<<a-b; } else if(c=='') { cout<<ab; } else if(c=='/') { if(b==0) { cout<<"Divided by zero!"; } else { cout<<a/b; } } else { cout<<"Invalid operator!"; } return 0; }

      • -3
        @ 2023-5-30 19:28:06

        SOS

        • -3
          @ 2023-5-30 17:01:21

          #include<iostream> using namespace std; int main() { int a,b; char c; cin>>a>>b>>c; if(c=='+') { cout<<a+b; } else if(c=='-') { cout<<a-b; } else if(c=='') { cout<<ab; } else if(c=='/') { if(b==0) { cout<<"Divide by zero"; } else { cout<<a/b; } } else { cout<<"Invalid operator"; } return 0; }

          • 1

          信息

          ID
          615
          时间
          1000ms
          内存
          256MiB
          难度
          5
          标签
          (无)
          递交数
          330
          已通过
          133
          上传者