第1个回答 2009-10-31
#include<stdio.h>
void main()
{int n;
scanf("%d",&n);
switch(n)
{
case 12:printf("当前是十二月");break;
case 11:printf("当前是十一月");break;
case 10:printf("当前是十月");break;
case 9:printf("当前是九月");break;
case 8:printf("当前是八月");break;
case 7:printf("当前是七月");break;
case 6:printf("当前是六月");break;
case 5:printf("当前是五月");break;
case 4:printf("当前是四月");break;
case 3:printf("当前是三月");break;
case 2:printf("当前是二月");break;
case 1:printf("当前是一月");break;
}
}本回答被提问者采纳
第2个回答 2009-10-31
这是类:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Answer
{
class NumToMonth
{
public static void Month(int monthNum)
{
switch (monthNum)
{
case 1: Console.WriteLine("一月 January");
break;
case 2: Console.WriteLine("二月 February");
break;
case 3: Console.WriteLine("三月 March");
break;
case 4: Console.WriteLine("四月 April");
break;
case 5: Console.WriteLine("五月 May");
break;
case 6: Console.WriteLine("六月 June");
break;
case 7: Console.WriteLine("七月 July");
break;
case 8: Console.WriteLine("八月 August");
break;
case 9: Console.WriteLine("九月 September");
break;
case 10: Console.WriteLine("十月 October");
break;
case 11: Console.WriteLine("十一月 November");
break;
case 12: Console.WriteLine("十二月 December");
break;
default: Console.WriteLine("请输入1-12之间的数");
break;
}
}
}
}
下面是运行代码:
static void Main(string[] args)
{
NumToMonth.Month(5);
}
第3个回答 2009-10-31
switch(int n)
{
case 1: cout<<"当前是一月"<<endl<<"英语";
case 2: