December 17, 2018
Day month Year
Threads: Write a program that reads from the keyboard 3 perform integer day, month, and output to the screen in the form of "dd / mm / yyyy".
Input: A line of 3 integers separated by a space.
Output: A string in the format date: dd/mm/yyyy
For example:
input: 5 6 2018 output: 05/06/2018
You are not logged in? Log in to Submit Now!
23 Comments
Add a Comment
You must be logged in to post a comment.
Console.WriteLine(DateTime.Parse(date).ToString(“dd/MM/yyyy”));
1. Accepted
2. Wrong Answer
Test Input:
8 12 1992
Test Output:
08/12/1992
Your Output:
12/08/1992
3. Accepted
Why sentence 2 wrong again admin =.=
You see Test output is different from your output.
str=”09 12 1992″
print(str.replace(” “, “/”))
why is it wrong?
Please see the difference between Test output and Your output.
30/2/2018 okay
What do you mean?
month 2 What do you do? 30, day 29 it's over.
I think this follows the format string, no need…
#include
int main()
{int a,b,c;
printf(“input:\n”);
scanf(“%d%d%d”,&a,&b,&c);
printf(“output:\nd/d/d”,a,b,c);
return 0;
}
e sai o dau a. ?
Please compare your output and test output.
scanf(“%02d d d”, &a, &b, &c); your dentist
I code in c++ but use if else, Do you know any faster way? ?
honey, they told me to print to the screen 3 what are you?, but for example yes 1 just that
What is it??
Can anyone help me with this in pascal state?
Test Input:
12 12 2018
Test Output:
12/12/2018
Your Output:
12/12/2018
Is there a way to remove whitespace in python? ? The result I made it 05 / 06 / 2018 which while the answer is 05/06/2018.
i = input()
on, sb, sc = i.split(‘ ‘)
a = int(on)
b = int(sb)
c = int(sc)
print(“%.2d”%a,’/’,”%.2d”%b,”/”,”%.4d”%c)
Sir, let me ask this question, my code is as follows :
#include
int main(){
int h = 0 , m = 0 , s=0, i = 60 ;
h<=24 , m <=60 ;
scanf("%d",&s);
if (s<i||m= i||m >= i,m = s/60,h=m/i);
printf(“%02d:%02d:%02d”,h,m=m%i,s=s%i);
return 0;
}
pass all 8 test but i want after time 23:59:59 return 00:00:00 how do i do it? ?
you divide the remainder by 24 is to be.
This lesson in pascal must use the If then statement right??
That's right.
Can anyone help me with this in pascal state?
Pascal:
Program NOW_THANG_NAME;
Uses crt;
Var now,thang:byte;
nam:integer;
Begin
Clrscr;
Readln(right,thang,nam);
If now < 10 then
Write('0',right,'/')
Else
Write(right,'/');
If thang < 10 then
Write('0',thang,'/')
Else
Write(thang,'/');
If nam < 1000 then
Begin
If nam < 100 then
begin
If nam < 10 then
Write('000',nam)
Else
Write('00',nam);
End
Else
Write('0',nam);
End
Else
Write(nam);
Readln;
End.