算日期,直接用JAVA API搞定了,小偷个懒。。
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Locale;
import java.util.Scanner;
public class Main
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
Calendar c = Calendar.getInstance();
int n;
DateFormat df = new SimpleDateFormat("yyyy-MM-dd EEEE",Locale.US);
while ((n = sc.nextInt()) != -1)
{
c.set(2000, 0, 1);
c.add(Calendar.DATE, n);
System.out.println(df.format(c.getTime()));
}
}
}