用java输入某年某月某日判断这是这一年的第几天用switch完成怎么做 我是学.net的,用我学的就是using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace zuoye5{class Program{static void Main(string[]args){Console.WriteLine(\"请输入日期:\");int n=int.Parse(Console.ReadLine());int y=int.Parse(Console.ReadLine());int r=int.Parse(Console.ReadLine());int tianshu=0;switch(y){case 1:{tianshu=r;break;}case 2:{tianshu=31+r;break;}case 3:{tianshu=31+28+r;break;}case 4:{tianshu=31+28+31+r;break;}case 5:{tianshu=31+28+31+30+r;break;}case 6:{tianshu=31+28+31+30+31+r;break;}case 7:{tianshu=31+28+31+30+31+30+r;break;}case 8:{tianshu=31+28+31+30+31+30+31+r;break;}case 9:{tianshu=31+28+31+30+31+30+31+31+r;break;}case 10:{tianshu=31+28+31+30+31+30+31+31+30+r;break;}case 11:{tianshu=31+28+31+30+31+30+31+31+30+31+r;break;}case 12:{tianshu=31+28+31+30+31+30+31+31+30+31+30+r;break;}default:{Console.WriteLine(\"你的输入有误!break;}}if(y>;2){if((n%4=0&n%100。0)|(n%。
用JAVA 题目:输入某年某月某日,判断这一天是这一年的第几天? import java.text.SimpleDateFormat;import java.util.Calendar;import java.util.Scanner;public class GetDate {public static void main(String[]args){Scanner scanner=new Scanner(System.in);System.out.println(\"请输入年:\");int year=scanner.nextInt();System.out.println(\"请输入月:\");int month=scanner.nextInt();System.out.println(\"请输入日:\");int day=scanner.nextInt();Calendar calendar1=Calendar.getInstance();calendar1.set(year,0,1);long time1=calendar1.getTimeInMillis();Calendar calendar2=Calendar.getInstance();calendar2.set(year,month-1,day);long time2=calendar2.getTimeInMillis();long result=(time2-time1)/1000/60/60/24;SimpleDateFormat format=new SimpleDateFormat(\"yyyy/MM/dd\");System.out.println(format.format(calendar2.getTime())+\"距离format.format(calendar1.getTime())+\"有\"+result+\"天\");}}
java 题目:输入某年某月某日,判断这一天是这一年的第几天? 我有参考其他题目,但是 有一个错误。请帮看 if((Year%4=0&Year%100。0)|Year%400=0)MONTH[2]={29};这一句应该是if((Year%4=0&Year%100。0)|Year%400=0)MONTH[2]=29;吧 另外一点 for(int i=0;i;i+)这句话应该是for(int i。