Home > Back-end >  Always make a mistake error C2181: illegal else without matching the if
Always make a mistake error C2181: illegal else without matching the if

Time:09-25

# include
using namespace std;
Int main ()
{
Int m, n;
Cin> m;
Int I, j;
Int name1 [100].
Int date1 [100].
for(i=0; i{
Cin> Name1 [I] & gt;> Date1 [I];
}
Cin> n;
Int name2 [100].
Int date2 [100].
for(j=0; J{
Cin> Name2 [j] & gt;> Date2 [j];
}
Cout<" Deleat "& lt; for(i=0; i{
for(j=0; J{
If (name1 [I]!=name2 [j])
{
Coutbreak;
}
If (name1=name2 [I] [j])
{
If (date1=date2 [I] [j])
{break; }
The else
{
Date1 date2=[I] [j];
break;
}
The else
{
break;
}

}

}
Cout<" Copy "& lt; for(i=0; i{
for(j=0; J{
If (name1 [I]!=name2 [j])
{
Name1=name2 [I] [j];
Date1 date2=[I] [j];
Coutbreak;
}

}
}
}

CodePudding user response:

Code editor of time attention indentation, else we should line up and the corresponding if,

CodePudding user response:

If VC, edit - all - Alt - F8 (code formatting)
  • Related