Cout<& lt;" Enter the diameter of the pizza: \ n "; Cin> Zhijing; The delete q; Cout<& lt;" Enter the name of the pizza company: \ n "; Getline (cin, gongshiming); The delete p; Cout<& lt;" Input the weight of the pizza: \ n "; Cin> Zhongliang; The delete m;
CoutCoutCout system("pause"); Return 0; }
CodePudding user response:
To enter a pizza diameter when a carriage return is not block, directly by getline () function reads,
cout & lt; <"Enter the diameter of the pizza: \ n"; Cin & gt;> Zhijing; The rewind (stdin);//shielding carriage return -- -- -- -- -- -- -- -- -- -- -- -- -- --
VS2015 debugging environment of c + +
To block a carriage return, please see the reference "C + + fflush () function and rewind () function," "C + + getchar () method of use" Wish I could help you!