上传了实验五,已确认无敏感信息
This commit is contained in:
Executable
+25
@@ -0,0 +1,25 @@
|
||||
//Main.java
|
||||
package task1;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Scanner;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Locale;
|
||||
|
||||
public class Main {
|
||||
public static void main(String[] args) {
|
||||
Scanner input = new Scanner(System.in);
|
||||
SimpleDateFormat in = new SimpleDateFormat("yyyy M dd");
|
||||
Date d = new Date();
|
||||
try {
|
||||
d = in.parse(input.nextLine());
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
SimpleDateFormat out = new SimpleDateFormat("yyyy MMMM dd EEEE", Locale.ENGLISH);
|
||||
String formattedDate = out.format(d);
|
||||
System.out.println("今天是" + out.format(d).toUpperCase());
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user