#include
#include
Int main () {
Char b [20];//store name temporary variable
//STD: : string name; Deposit//keyboard input name
STD: : vector
While (1) {
Printf (" please enter a name (0) : ");
Scanf_s (" % c ", b);
If (STRCMP (b, "0")==0) break;//input end 0
Vname. Push_back (b);//the input the name of the storage containers
}
For (int I=0; i
}
return 0;
}
CodePudding user response:
Scanf_s (" % c ", b); Input format is wrong, to scanf_s (" % s ", b, sizeof (b));CodePudding user response: