#include<stdio.h>
#include<stdlib.h>
int main()
{
int num;
char c;
int grade;
printf("Enter 1 to letter or 2 to number: ");//判断将要输入的是字母还是数字
scanf("%d",&grade);
switch(grade)
{
case 1 : printf("Please enter the number: ");
scanf("%d",&num);//读入一个数字
printf("%d's letter is %d\n",num,num);
break;
case 2 : printf("Please enter the letter: ");
scanf("%c",&c);//读入一个字母
printf("%c's Asc is %c\n",c,c);
break;
default :printf("输入错误!");
}
system("pause");
return 0;
}