我纳了个闷了,为啥报错啊,报错21行

B2052 简单计算器

FengYuXinMing @ 2022-09-14 19:24:57

#include <bits/stdc++.h>
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 << a - b;
    }
    else if (c == '/'){
        if (b == 0){
            cout << "Divided by zero!";
        }
        cout << a / b;+
    }//这就是21行
    else{
        cout << "Invalid operator!";
    }
    return 0;
}

by Katz @ 2022-09-14 19:26:16

眼睛不要可以捐给有需要的人,20行


by Wildchesse @ 2022-09-14 19:26:23

"a/b;+"

by FengYuXinMing @ 2022-09-14 19:27:25

况且在DEV - C++(c++的一个编译器)上运行就不报错


by FengYuXinMing @ 2022-09-14 19:28:03

@PMAC 删掉也是一样亲,真当我瞎啊,


by Wildchesse @ 2022-09-14 19:28:49

新用户必读并不是一个摆设呢,亲亲


by Katz @ 2022-09-14 19:30:20

@hutongyu 不一样你马,怕不是真的瞎


by Katz @ 2022-09-14 19:30:45

不会c++可以学会了再发帖子


by HopesandDreams @ 2022-09-14 19:30:52

@hutongyu 大哥,我们都知道Dev是个编辑器


by Wildchesse @ 2022-09-14 19:31:17

@PMAC 下雪预警......


by FengYuXinMing @ 2022-09-14 19:31:34

@Wildchesse 新用户必读说我刚才那句话有问题是吗?亲


| 下一页