{
Int k, by bm, bd.
While ((pdates [k] <'0' | | pdates [k] & gt; '9') & amp; & K
For (; Pdates [k]!='/' & amp; & K
k++;
Bm=0;
For (; Pdates [k]!='/' & amp; & Pdates. Length (); K++)
Bm=bm * 10 + pdates [k] - '0';
If (pdates [k]=='/')
{
k++;
Bd=0;
For (; K
}
The else
Bd=1;
D [0]=by;
D [1]=bm;
D [2]=bd;
}
Very urgent, thank you for your bosses
CodePudding user response:
Is this implemented? But it seems {} is not quite rightCodePudding user response:
A string from left to right in turn determine (date) (month) (year), separated by/, decide to find the location of the 0-9, before then began, in turn, determine the, years, are divided by month, bm, and determine whether, so continue to determine, not just the default is 1There is a problem as uninitialized variables, write the code of this guy is a novice,
CodePudding user response:
string STR="2019/1/24";
Int year, month, day.
Stringstream stream;
char c;
The stream & lt;The stream & gt;> Year;
The stream & gt;> c;
The stream & gt;> The month;
The stream & gt;> c;
The stream & gt;> Day;
cout