Home > Back-end >  C language problem
C language problem

Time:06-07

As shown in figure, how to implement the input in turn

CodePudding user response:

The for loop can be,

CodePudding user response:

Help me with my thumb up blink my answer for your reference

CodePudding user response:

reference 1st floor wowpH response:
for loop can,

For an input, can achieve a detailed talk about

CodePudding user response:

refer to the second floor yma16 response:
help me with my thumb up blink my answer for your reference

Have thumb up , please speak, please speak

CodePudding user response:

#include
Int main (void)
{
Int n=1, student [5].
While (+ + n<5)
{
Printf (" please enter the % d grades: \ n ", n + 1);
The scanf (" % d ", & amp; Student [n]);
}
Printf (" student id \ t result \ n ");
for(int i=0; i<5; + + I)
{
Printf (" % d % d \ t \ n ", I + 1, student [I]);;
}
return 0;
}

CodePudding user response:

Attention to direct messages to help solve the problem of simple

CodePudding user response:

#include
# define maxsize 8
Int main ()
{
Int n=1, student [maxsize];
While (+ + n{
Printf (" please enter the % d grades: \ n ", n + 1);
The scanf (" % d ", & amp; Student [n]);
}
Printf (" student id \ t result \ n ");
for(int i=0; i{
Printf (" % d % d \ t \ n ", I + 1, student [I]);;
}
return 0;
}//concern direct messages for free to solve simple problems

CodePudding user response:

refer to 7th floor yma16 response:
# include
# define maxsize 8
Int main ()
{
Int n=1, student [maxsize];
While (+ + n{
Printf (" please enter the % d grades: \ n ", n + 1);
The scanf (" % d ", & amp; Student [n]);
}
Printf (" student id \ t result \ n ");
for(int i=0; i{
Printf (" % d % d \ t \ n ", I + 1, student [I]);;
}
return 0;
}//concern DMS solve simple problem free

Thank you very much, the n=1 to n=0, + + n n++ can instead

CodePudding user response:

references to rise this code on the eighth floor stock reply:
Quote: refer to 7th floor yma16 response:
# include
# define maxsize 8
Int main ()
{
Int n=1, student [maxsize];
While (+ + n{
Printf (" please enter the % d grades: \ n ", n + 1);
The scanf (" % d ", & amp; Student [n]);
}
Printf (" student id \ t result \ n ");
for(int i=0; i{
Printf (" % d % d \ t \ n ", I + 1, student [I]);;
}
return 0;
}//concern DMS solve simple problem free

Thank you very much, the n=1 to n=0, + + n to n++ please

Can but that is not good, the array subscript from zero beginning, that is shown to change the subscript of 0 is useless to waste of memory

CodePudding user response:

Use two for loop and the scanf printf function

CodePudding user response:

I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10581430.html
I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10768339.html
  • Related