幫忙看一下哪裡錯誤 Thank
#include<iostream>
using namespace std;
int main()
{
int n;//幾筆資料
int arr[100][100]={0};
while( cin >> n )
{
for( int i=0; i < n; i++ )
{
for( int j=0; j < 3; j++ )
{
cin >> arr[i][j];
if( arr[i][0] == 1 && j == 2 )
arr[i][0] = arr[i][j-1] + arr[i][j];
else if( arr[i][0] == 2 && j == 2 )
arr[i][0] = arr[i][j-1] - arr[i][j];
else if( arr[i][0] == 3 && j == 2 )
arr[i][0] = arr[i][j-1] * arr[i][j];
else if( arr[i][0] == 4 && j == 2 )
arr[i][0] = arr[i][j-1] / arr[i][j];
}
}
for( int y = 0; y < n; y++ )
{
cout <<arr[y][0] << endl;
}
}
return 0;
}