//好久没来了,帮你做了下,练下手感,
//1. 编写计算n的阶乘的程序。
/*
#include <stdio.h>
double Jie_cheng(int);
double Jie_Cheng(int number)
{
if(number==1)
return 1;
else
return number*Jie_Cheng(number-1);
}
int main()
{
int number;
printf("please enter the number:\n");
scanf("%d",&number);
printf("%d!=%.lf.\n",number,Jie_Cheng(number));
return 0;
}
*/
//2.编写一个两位十进制数AB,其中AB×BA=403,求A和B的值的程序
/*
#include <stdio.h>
void process(int number)
{
int i;
int j;
int flag=1;
for(i=1;i<10;i++)
{
for(j=1;j<10;j++)
{
if((i*10+j)*(j*10+i)==number)
{
flag=0;
printf("%d=%d*%d\n",number,i*10+j,j*10+i);
}
}
}
if(flag==1)
printf("Don't exist the number.\n");
}
int main()
{
int number;
do
{
printf("please enter the number(100<=number<=9801).\n");
scanf("%d",&number);
}while(number<100||number>9801);
process(number);
return 0;
}
*/
#include <stdio.h>
int main()
{
char op;
printf("Please input a operator:\n");
scanf("%c",&op);
switch(op)
{
case 'a':
printf("op=%c %s\n",op,"American");
break;
case 'b':
printf("op=%c %s\n",op,"Britain");
break;
case 'c':
printf("op=%c %s\n",op,"China");
break;
case 'd':
printf("op=%c %s\n",op,"Denmark");
break;
default:
printf("Other");
}
return 0;
}