#include
#include
void leters()
{
char a[100];
int i;
int n=0;
a[0]='0';
printf("input phonenumber,end up with #\n");
while(a[n]!='#')
{
n++;
a[n]=getchar();
if(a[n]>='A'&&a[n]<='C')
a[n]='2';
if(a[n]>='D'&&a[n]<='F')
a[n]='3';
if(a[n]>='G'&&a[n]<='I')
a[n]='4';
if(a[n]>='J'&&a[n]<='L')
a[n]='5';
if(a[n]>='M'&&a[n]<='O')
a[n]='6';
if(a[n]>='P'&&a[n]<='S')
a[n]='7';
if(a[n]>='T'&&a[n]<='V')
a[n]='8';
if(a[n]>='W'&&a[n]<='Z')
a[n]='9';
}
for(i=1;i
printf("\n");
}
void bonus()
{
float a;
printf(" please input profits: ");
scanf("%f",&a);
if(a<=10000)
printf("bonus is:%f",a*0.1);
if(a>10000&&a<=20000)
printf("bonus is:%f",10000*0.1+(a-10000)*0.075);
if(a>20000&&a<40000)
printf("bonus is:%f",10000*0.1+100000.075+(a-20000)*0.005);
if("a>40000")
printf("bonus is:%f",10000*0.1+100000.075+(20000)*0.005+(a-40000)*0.003);
}
void calender()
{
int a,b,c,i;
printf("please input the days of monthly calender:");
scanf("%d",&a);
printf("\n");
printf("please input this month the start of the day belongs to the week(1=sunday,2=monday,3=tuesday,4=wednesday,5=thursday,6=friday,7=saturday):");
scanf("%d",&b);
for(c=0;c
for(i=1;i<=9;i++)
{
printf("%d ",i);
if((i+b-1)%7==0)
printf("\n");
}
for(i=10;i<=a;i++)
{
printf("%d ",i);
if((i+b-1)%7==0)
printf("\n");
}
printf("\n");
}
void daffodil()
{
int a,b,c,m,n;
printf("the number of daffodil is:\n");
for(a=1;a<10;a++)
for(b=0;b<10;b++)
for(c=0;c<10;c++)
{
m=a*a*a+b*b*b+c*c*c;
n=a*100+b*10+c;
if(m==n)
printf("%d ",n);
}
printf("\n");
}
void value()
{
int i,n,min=0,max=0;
int b[1]={0};
printf("input number:");
scanf("%d",&n);
printf("\n");
printf("%d numbers is\n",n);
for(i=0;i<=n-1;i++)
scanf("%d",&b[i]);
for(i=0;i
if(b[i]
else if(b[i]>max)
max=b[i];
}
printf("in the %d numbers,max is %d,min is %d ",n,max,min);
}
void main()
{int i,c;
for(i=0;i<=45;i++)
printf("*");
printf("\n");
printf("main menu:\n1.leters digital conersion\n2.issuing bonus\n3.prints monthly calender\n4.prints daffodil\n5.searching for the value\n6.exit\n");
for(i=0;i<=45;i++)
printf("*");
printf("\n");
do
{
printf("---please putin the option of main menue ");
scanf("%d",&c);
}while(c!=1&&c!=2&&c!=3&&c!=4&&c!=5&&c!=6);
if(c==6)
return;
else
switch (c)
{
case 1:leters();
break;
case 2:bonus();
break;
case 3:calender();
break;
case 4:daffodil();
break;
case 5:value();
break;
}
}