Gauss Diary
Gauss, the great mathematician, has a good habit of keeping a diary in any case.
His diary has a different place, he never dated, but with an integer instead of, for example: 4210
Later, people knew that the whole number was a date, which means that it was the day after Gauss was born. It may also be a good habit to remind the owner: How much time can be wasted when the days go by.
Gauss was born in: April 30, 1777.
The diary of an important theorem in Gauss's discovery is labeled: 5343, so it can be calculated that day is: December 15, 1791.
Gauss got his Ph. D. Journal on the day marked: 8113
Please calculate the date of Gauss's doctorate.
The format for submitting the answer is: YYYY-MM-DD, for example: 1980-03-21
Please submit the answer in the browser in strict accordance with the format.
Note: Only submit this date, do not write additional content, such as: descriptive text.
Import java.util.*;
public class main{public
static void Main (String args[])
{
Scanner cn=new Scanner (system.in);
int Data=cn.nextint ();
Calendar cc=calendar.getinstance ()//Get system time
Cc.set (1777, 3, 30);//change system time setup time because the month in the system is 0-11 so April is actually 3
. int count=0;
while (true)
{
cc.add (cc. Date, 1);/Let the day count++ day back
;
if (count==data) break;
System.out.println (Cc.get (calendar.year) + "-" + (Cc.get (calendar.month) +1) + "-" + (Cc.get (calendar.date)-1));
The output of the month and then add a plus back
}
}
The result is 1799-7-16.
Note that this topic is Gauss's birth date as the first day, so I subtract the day from the final output statement because I'm talking about the first day after birth, which is number 5-1.