請各位高手幫忙
謝謝
#include<iostream>
using namespace std;
int main()
{
int n,a,b,c;
b>=1;
c<=2147483647;
while(cin>>n)
{
for(int i=0;i<n;i++)
{
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;
}
WA (line:8)
答案不正確
您的答案為: -642277118 正確答案為: 38281382169387266
請各位高手幫忙
謝謝
#include
using namespace std;
int main()
{
int n,a,b,c;
b>=1;
c<=2147483647;
while(cin>>n)
{
for(int i=0;i
{
cin>>a>>b>>c;
switch(a)
{
case 1:
cout<<
break;
case 2:
cout<<
break;
case 3:
cout<<
break;
case 4:
cout<<
break;
default:
break;
}
}
}
return 0;
}
WA (line:8)
答案不正確
您的答案為: -642277118 正確答案為: 38281382169387266
用long long int
把它改成long long int n,a,b,c;
就可以了