4 条题解

  • 0
    @ 2026-4-12 10:50:24

    (ke,khm//咳,咳m)

    我非dalou,但****

    /*整数版*/
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
        int x,y;
        char z;
        cin>>x>>y>>z;
        if(z=='+')
        {
        	cout<<x+y; /*+*/
    	}
        if(z=='-')/*-*/
        {
        	cout<<x-y; /*输出x-y;*/
    	}
        if(z=='*')/*×*/
        {
        	cout<<x*y; /*输出xy;*/
    	}
        if(z=='/')/*÷*/
        {if(y!=0) /*y不==0*/
        {
    	printf("%.2lf",x/y);/*输出“2 long float”(.后长度为2) x÷y;*/ 
    	}	
    	else cout<<"运算符有误"; /*y==0;输出运算符有误;*/
    	}
        return 0;
    }
    

    信息

    ID
    120
    时间
    1000ms
    内存
    128MiB
    难度
    1
    标签
    递交数
    26
    已通过
    30
    上传者