迴圈
輸入
依照規則輸出
#include <iostream>
using namespace std;
int main()
{
int times, a;
long long int b, c;
while (cin >> times)
while(times--)
{
cin >> a >> b >> c;
switch(a)
{
case 1:
cout << b+c << endl;
break;
case 2:
cout << b-c << endl;
break;
case 3:
cout << b*c << endl;
break;
case 4:
cout << b/c << endl;
break;
default:
break;
}
}
return 0;
}
留言列表