如題
請問該怎麼debug,我用DEV C++編譯都過
感恩各位大神
程式碼:
#include<iostream>
using namespace std;
int main(){
int arr[4];
while(cin >> arr[0] ){
cin >> arr[1] >> arr[2] >> arr[3];
int times,i,j,countA=0,countB=0,temp[4],arr1[4];
cin >> times;
for(j=0;j<times;j++){
countA=0,countB=0;
for(i=0;i<times;i++){
cin >> arr1[i];
}
for(i=0;i<times;i++){
temp[i] = arr[i];
}
for(i=0;i<times;i++){
if(arr1[i]==arr[i]){
countA++;
arr[i]=10;
arr1[i]=11;
}
}
if(arr1[0]==arr[1] || arr1[0]==arr[2] || arr1[0]==arr[3]){
countB++;
// cout << arr1[0] << endl;
}
if(arr1[1]==arr[0] || arr1[1]==arr[2] || arr1[1]==arr[3]){
countB++;
// cout << arr1[1] << endl;
}
if(arr1[2]==arr[1] || arr1[2]==arr[0] || arr1[2]==arr[3]){
countB++;
// cout << arr1[2] << endl;
}
if(arr1[3]==arr[1] || arr1[3]==arr[2] || arr1[3]==arr[0]){
countB++;
// cout << arr1[3] << endl;
}
cout << countA <<"A" <<countB << "B" << endl;
for(i=0;i<times;i++){
arr[i] = temp[i];
}
}
}
return 0;
}