为您找到"

C++编程 用switch-case语句编程,输入月份名称(1~12月份),输出其英文...

"相关结果约100,000,000个

请各位大侠帮忙写一个程序(输入年份和月份,显示该月的月历)

/*打印输入月份月历表*/ void print(int y,int m);int main(){ int y,m;printf("输入年份和月份:");scanf("%d%d",&y,&m);print(y,m);return 0;} int getdate(int y,int m){ int w=(y+(y-1)/4-(y-1)/100+(y-1)/400)%7;int days=0;switch(m){ case 12: days+=...

...用户输入的一个1-12之间的整数,用switch语句输出对应月份的天数...

("请输入要查询的月份:");\x0d\x0anum=sc.nextInt();\x0d\x0aif(num>12 ||num<1){\x0d\x0aSystem.out.println("你输入的月份错误,请重新输入");\x0d\x0acontinue;\x0d\x0a}\x0d\x0atemp=false;\x0d\x0a}\x0d\x0aint day...

C语言编程输入数字1到7 分别输出周一到周日的英文单词

//这个就不用注释了吧 include "stdio.h"void main(){ int i;printf("输入1~7其中一个数字:");scanf("%d",&i);switch(i){ case 1: printf("Monday\n");break;case 2: printf("Tuesday\n");break;case 3: printf("Wednesday\n");break;case 4: printf("Thursday\n");break;case...

...第几天。用if语句和switch语句分别实现。要求用C++程序

int year,mon,day;int IsLeapYear=0;//是否是闰年 int daynum=0;//今天是今年的第几天 int DayNumAMonth;//这个月有多少天 cout <<"Please input year month day"<<endl;cin>>year>>mon>>day;if( (year%4==0 && year%100 !=0) || year%400==0)IsLeapYear=1;switch (mon){ cas...

...判断是春夏秋冬那个季节,要求使用方法定义四个季节。 用switch...

package test;import java.util.Scanner;public class Spring {public static void main(String[] args) {Scanner sca = new Scanner(System.in);while (true) { int month = sca.nextInt();switch (month) {case 1:System.out.println("该季节为春季");break;case 2:System.out.println("...

...输入的一个1-12之间的整数,利用switch语句输出对应月份的天数_百 ...

case 12:{ System.out.println(""+temp+"月为31天!!!");break;} default:{ System.out.println("输入的月份有误!!!");break;} } } } public class SwitchDemo{ public static void main(String args[]){ int temp=0;Switch sw=new Switch();System.out.print("请输入月份:");...

...判断这一天是这一年的第几天?请用switch语句以及累加法完成...

main(){ int year, month, day, feb_day = 28, n = 0; scanf("%d%d%d", &year, &month, &day); if ((year%100 && year % 4 == 0) || (year%100 == 0 && (year % 400 == 0))){ feb_day = 29; }n = day;switch(month){case 2:n += 31;break...

...输入的一个1~12之间的整数,利用Switch语句输出对应月份的天数...

import java.util.Scanner;public class xxx { / param args / public static void main(String[] args) { Scanner scan = new Scanner(System.in);int i = scan.nextInt();if (i<1&&i>12) { System.out.println("请重新输入月份");i = scan.nextInt();} switch(i){ case 1: ...

1.用枚举型定义春夏秋冬四个季节,当输入一个月份,输出该月份对应...

define Spring 0 define Summer 1 define Autumn 2 define Winter 3 void main(){ int mon;printf("请输入月份:");scanf("%d",&mon);if(mon<1 || mon > 12){ printf("你家月份里有%d月啊?",mon);} else{ int temp = (mon-1)/3;switch(temp){ case Spring: printf("Spring")...

用C# 用户从键盘输入月份,使用switch语句输出该月份的天数

string a = Console.ReadLine();Console.WriteLine("请输入月份数字:");string b=Console.ReadLine();string c = "";if (b == "2"){ c = (Convert.ToInt32(a) % 4 == 0) ? (b + "闰年") : (b + "非闰年");} else c = b;switch (c){ case "1":Console.WriteLine("...
1 2 3 4 5 6 7 8 9

相关搜索