+ 6

Tell my mistake its work on other compiler but not work on solo. This coach questio https://www.sololearn.com/coach/75?ref=app

Askhttps://code.sololearn.com/cXCS8KVXIwQx/?ref=app

15th Jan 2020, 4:56 PM
A S Raghuvanshi
A S Raghuvanshi - avatar
9 Antworten
0
Line 63: y[yi++]=s[i+1]; And it should work.
15th Jan 2020, 5:20 PM
Mihai Apostol
Mihai Apostol - avatar
+ 2
It is running. You have some warnings about indentation you should check. As for the result try September 15, 2000 and see what happens
15th Jan 2020, 5:07 PM
Mihai Apostol
Mihai Apostol - avatar
+ 1
Between the comma and the year there is a space in the input from test cases for the format Month Day, Year
15th Jan 2020, 5:13 PM
Mihai Apostol
Mihai Apostol - avatar
0
I tried but its gave some errors which i don't understood what happened? its working on others compiler without any errors.
15th Jan 2020, 5:09 PM
A S Raghuvanshi
A S Raghuvanshi - avatar
0
For the input 1/2/1991 Output: 2/1 /1991 extra unnecessary space is adding... For input November 1, 1991 (here you have a space for input after 1) Output: 1/11/ 199 extra space with last 1 missing.. Hoping you can find other mistakes if any..
15th Jan 2020, 5:17 PM
Jayakrishna 🇮🇳
0
Anyone can fix it
15th Jan 2020, 5:19 PM
A S Raghuvanshi
A S Raghuvanshi - avatar
0
I don't understood
15th Jan 2020, 5:22 PM
A S Raghuvanshi
A S Raghuvanshi - avatar
0
First case successful run but other cases are failed
15th Jan 2020, 5:26 PM
A S Raghuvanshi
A S Raghuvanshi - avatar
0
If part solved.. Similarly with just 2 more steps you can solve else part easily .. Try. if (isdigit(s[0])) { for (int i=0;i<n;i++) { if (s[i]=='/'){ k++; continue; } switch(k) { case 0: m[mi++]=s[i];break; case 1: d[di++]=s[i];break; case 2: y[yi++]=s[i]; } } for(int j=0;j<di;j++) cout<<d[j]; cout<<"/"; for(int j=0;j<mi;j++) cout<<m[j]; cout<<"/"; for(int j=0;j<4;j++) cout<<y[j]; //cout<<"i" <<endl; } Hoping you get it else part easily....
15th Jan 2020, 7:08 PM
Jayakrishna 🇮🇳