Home > Back-end >  Encounter problems, not a bit idea, hope bosses look
Encounter problems, not a bit idea, hope bosses look

Time:04-26

What have been the way to the C language when the input line is no longer the input,

CodePudding user response:

Reference:
 # include 
Int main ()
{
Int n=0, m=0;
While (the scanf (" % d % d ", & amp; N, & amp; M)!=EOF & amp; & (getchar ()!='\ n'));//enter CTRL + z or enter the input end of the
Printf (" n=% d, m=% d \ n ", n, m);

return 0;
}

CodePudding user response:

The fgets, read a line, return back,

Can also use circulation judge '\ n' character;

 while ((ch=getchar ())! ) 
='\ n';
  • Related