我的代码有什么不对?

-5 c++

#include <iostream> 

using namespace std;

float sum(float a,float b);

float subs(float a, float b);

float multiple(float a, float b);

float division(float a, float b);

int main()

{//main

    int a,b;

    char o ;
    cout<<"input your calculation with  operation (+,-,/,*) such as 5+6 : /n ";
    cin >> a >> o >> b ;
    switch('o')
    {
    case '+':

        sum(float a, float b);
        break;

    case '-':

        subs(float a, float b);
        break;

    case '*':

         multiple(float a, float b);
        break;

    case '/':

         division(float a, float b);
        break;

    default :
        cout << "error, try again " <<endl;

    }
    return 0;
}//main

float sum(float a,float b)
{//sum

    float total= a+b;
    return total;
}//sum

float subs(float a, float b)
{//subs

    float total=a-b;
    return total;
}//subs     

float multiple(float a, float b)
{//multiple

    float total=a*b;
    return total;
}//multiple

float division(float a, float b)
{//division

    float total=a/b;
Run Code Online (Sandbox Code Playgroud)

小智 7

从表面上看,你最后错过了一个大括号.在操作上,您的switch语句将打开一个常量"o",而不是变量o.