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';