Home > Back-end >  Who is a great god can help change, knelt down, I'm just a rookie
Who is a great god can help change, knelt down, I'm just a rookie

Time:09-25


# include
Int main ()
{
Int a [20], I, num, j, n=0;
For (I=0;; I++)
{
Scanf_s (" % d ", & amp; A [I]);
If (a [I]=='\ n')
{
Num=I - 1;
break;
}
}
For (I=0; i For (j=I + 1; J & lt; Num - I; J++)
{
If (a [I]!=a [j])
N++;
}
Printf (" % d \ n ", n);
return 0;
}

CodePudding user response:

Is what's the problem?

CodePudding user response:

Yes main input is the place my infinite loop
I want to press enter to end

CodePudding user response:

10 you input is over

CodePudding user response:

 
# include
Int main ()
{
Int a [20], I, num, j, n=0;
For (I=0;; I++)
{
Scanf_s (" % d ", & amp; A [I]);
If (a [I]=='\ n')
{
Num=I - 1;
break;
}
}
For (I=0; i For (j=I + 1; J & lt; Num - I; J++)
{
If (a [I]!=a [j])
N++;
}
Printf (" % d \ n ", n);
return 0;
}

To help you with a code block first, convenient, input \ n ASCII, 13
  • Related