#include
Struct that
{
Int count;
Char name [20].
};
Int main ()
{
Int I, j;
Struct that stu [3]={{0, "jack"}, {0, "Bob"}, {0, "John"}};
Printf (" please vote for the precious, 0 representative jack 1 representative Bob 2 representative John \ n ");
for(i=0; i<10; I++)
{the scanf (" % d ", & amp; J);
If (j=0)
Stu [0]. Count++;
If (j=1)
Stu [1]. Count++;
If (j=2)
Stu [2]. Count++;
J=10;
}
Printf (" jack of the vote is % d \ nbob votes, is % d \ njohn votes is % d \ n ", stu [0]. Count, stu. [1] the count, stu. [2] the count);
CodePudding user response:
Bosses, for helpCodePudding user response:
If (j=0)Instead of
If (j==0)
CodePudding user response:
J=0 to j==0, comparing with the==, the rest of the 1 and 2 is the same problemCodePudding user response:
I went to, I was too stupid, this kind of low-level mistakes