你用switch寫不出來
#include <iostream>
using namespace std;
int main()
{
int long long n, c1, c2, c3, i;
cin >> n;
//注意,這裡要分開來輸入n與c
for (i = 0 ; i < n ; i++)
{
cin >> c1 >> c2 >> c3;
//判斷
if (c1 == 1)
cout << c2+c3 << endl;
else if (c1 == 2)
cout << c2-c3 << endl;
else if (c1 == 3)
cout << c2*c3 << endl;
else if (c1 == 4)
cout << c2/c3 << endl;
}
return 0;
}