#include<stdio.h>
#define MAXSIZE 100
int
main()
{
int c;
int r,t=0,j;
int k,i,m,n;
int a[MAXSIZE];
printf("here are 6 menus :\n");
printf("1. Findnum\n");
printf("2. SixorSeven\n");
printf("3. Detective\n");
printf("4. Bear\n");
printf("5. Diamond\n");
printf("6. Goodbye\n");
printf("input 1 - 6 :\n");
scanf("%d",&c);
switch(c)
{
case 1:
{
printf(" welcome to Findnum!\n");
for(i=0;i<=9;i++)
{
m = (3*10+i)*6237;
for(j=1;j<=9;j++)
{
n = (10*j+3)*3564;
if(m==n)
printf("i=%d, j=%d\n",i,j);
}
}
printf("m=%d,n=%d",m,n);
}
break;
case 2:
{
printf(" welcome to SixorSeven!\n");
for(r=1;r<=100;r++)
{
if(r%6==0||r%7==0)
{
a[t]=r;
t++;
}
}
for(j=0;j<t;j++)
{
if(a[j]%6!=0||a[j]%7!=0)
{
printf("%d\n",a[j]);
}
}
}
break;
case 3:
{
int a,b,ab,ba;
printf(" welcome to Detective!\n");
for(a=0;a<=9;a++)
{
for(b=0;b<=9;b++)
{
ab=a*1000+a*100+b*10+b;
for(k=0;k<100;k++)
{
ba=k*k;
if(ab==ba)
printf("ab=%d\n",ab);
}
}
}
}
break;
case 4:
{
printf(" welcome to Bear!\n");
int b[10],sum=0;
b[8]=1;
sum+=2*b[8]+2;
for(i=7;i>=0;i--)
{
b[i]=b[i+1]+2;
sum+=b[i]+2;
}
printf(" sum=%d\n",sum);
}
break;
case 5:
printf(" welcome to Diamond!\n");
break;
case 6:
printf(" Goodbye!\n");
break;
default:
printf("error!\n");
}
return(0);
}