2 条题解

  • 0
    @ 2023-5-19 18:13:47

    享受 copycopy 的快乐

    #include <iostream>
    #include <stack>
    #include <cmath>
    #include <vector>
    #include <string.h>
    #include <queue>
    #include <stdio.h>
    #include <iomanip>
    #include <cstdio>
    #include <algorithm>
    #define LL long long
    #define double long double
    using namespace std;
    const int N = 3e1 + 10;
    const int INF = 0x3f3f3f3f;
    int a, b;
    char op;
    signed main()
    {
    	cin >> a >> op >> b;//按照题意输入
        int ans = 0;//答案
        if(op == '+')
        {
            ans = a + b;//计算答案
            if(ans != 1)//不是1
            {
                printf("steve has %d kuns\n", ans);//kuns
            }
            else
            {
                printf("steve has 1 kun\n");//kun
            }
        }
        //写完就能复制了(喜
        if(op == '-')
        {
            ans = a - b;
            if(ans != 1)
            {
                printf("steve has %d kuns\n", ans);
            }
            else
            {
                printf("steve has 1 kun\n");
            }
            //copy
        }
        if(op == '*')
        {
            ans = a * b;
            if(ans != 1)
            {
                printf("steve has %d kuns\n", ans);
            }
            else
            {
                printf("steve has 1 kun\n");
            }
            //copy
        }
        if(op == '/')
        {
            ans = a / b;
            if(ans != 1)
            {
                printf("steve has %d kuns\n", ans);
            }
            else
            {
                printf("steve has 1 kun\n");
            }
            //copy
        }
    	return 0;
    }
    

    信息

    ID
    17
    时间
    1000ms
    内存
    512MiB
    难度
    6
    标签
    (无)
    递交数
    20
    已通过
    12
    上传者