⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 noname03.cpp

📁 simulation for computer selection
💻 CPP
字号:
#include<stdio.h>
#include<stdlib.h>
#include<conio.h>
//#define seed 56
  void r1();
  void r3();
  void r2();
  void r4();
  void f1();
  void f2();
  void f4();
  void f3();
 int seed,res1,res2,res3,res4;
		   char str1[4],str2[4],str3[4],str4[4],fstr[4],fstr1[4],fstr2[4],fstr3[4];
		   char *buff[] = {
				     "ache","acne","acre","adze","ague","aloe","apse","east","edit","emit","exit","tale","talc","talk","tall","tele","tell","tilt","till","tile","lace","lack","lacy","lade","lady","lair","lake","lama", "lamb"
				  };
 char * s[]={
     "ache - continuous dull",
     "pain or mental distress.",
    "acne - skin condition with",
    "red pimples.",
    "acre - measure of land.",
    "...",
    "adze - tool like an axe, with an",
    "arched blade at right angles to the handle.",
    "ague - malarial fever. or  shivering fit.",
    "...",
    "aloe - plant of the lily family with",
    "toothed fleshy leaves.",
    "apse - large arched or domed recess",
    "esp. at the end of a church.",
    "east - a point of the horizon where",
    "the sun rises at the equinoxes",
    "edit - assemble, prepare, or modify",
    " (written material for publication)",
    "emit - give or send out (heat, light,",
    "a smell, sound, etc.); discharge.",
    "exit - passage or door by which to",
    "leave a room etc. or right of going out.",
    "tale - narrative or story.",
    "in breach of confidence.",
    "talc - talcum powder. or magnesium",
    "silicate formed as soft flat plates.",
    "talk  - converse or communicate verbally.",
    "....",
    "tall - of more than average height.",
    "....",
    "tele - form 1 at or to a distance",
    "(ex telescope).",
    "tell - relate in speech or writing",
    "(tell me a story)",
    "tilt - assume a sloping position;",
    "heel over",
    "till - up to or as late as or up",
    "to the time of.",
    "tile  - thin slab of concrete or",
    "baked clay etc. used for roofing.",
    "lace - fine open fabric or trimming,",
    "made by weaving thread in patterns.",
    "lack - deficiency. or be without or",
    "deficient in.",
    "lacy - resembling lace fabric.",
    "...",
    "lade - a load (a ship). b ship (goods).",
    "....",
    "lady - a woman regarded as being of",
    "superior social status.",
    "lair - wild animal's resting-place.",
    "....",
    "lake - large body of water surrounded",
    "by land.",
    "lama - tibetan or Mongolian Buddhist",
    " monk.",
    "lamb - young sheep. or its flesh as",
    "food.",
};

		   char *buff1,*buff2,*buff3,*buff4;
void main()
{



 printf("enter the seed to select random");
 scanf("%d",&seed);
 srand(seed);
 clrscr();
 r1();
 r2();
 r3();
 r4();
getch();
}

 void r1()
 {
 for(;;)
  {
 float x1=rand()/32768.0;

 int n1=1+(int) (29*x1);
if(n1>0&&n1<7)
{
res1=n1;
break;
}else
{
continue;
}
  }
 int i=0;
 while(i<=3)
  {
 str1[i]=buff[res1][i];
i++;
   }
   str1[4]='\0';
      f1();
}
void r2()
{
 for(;;)
  {
 float x1=rand()/32768.0;

 int n1=1+(int) (29*x1);
if(n1>=7&&n1<11)
{
 res2=n1;
break;
}else
{
continue;
}
  }
  int i=0;
 while(i<=3)
  {
 str2[i]=buff[res2][i];
    i++;
   }
   str2[4]='\0';
     f2();
}

void r3()
{
 for(;;)
  {
 float x1=rand()/32768.0;

 int n1=1+(int) (29*x1);
if(n1>=11&&n1<20)
{
res3=n1;
break;
}else
{
continue;
}
 }
 int i=0;
 while(i<=3)
  {
 str3[i]=buff[res3][i];
i++;
   }
   str3[4]='\0';
    f3();

}
void r4()
{
 for(;;)
  {
 float x1=rand()/32768.0;

 int n1=1+(int) (29*x1);
if(n1>=20&&n1<29)
{
res4=n1;
break;
}else
{
continue;
}
  }
  int i=0;
 while(i<=3)
  {
 str4[i]=buff[res4][i];
i++;
   }
   str4[4]='\0';
   f4();

}

void f1()
{
  buff[res1][3]='9';

  int j=0,k=0;
  while(j<3)
  {
  if(buff[res1][j]!='9')
  {
 fstr[k]=buff[res1][j];
   k++;
  }
    j++;
  }
  fstr[k]='\0';
  buff1=fstr;
 //  printf("\n%s\n",str1);
//   printf("\n%s\n",buff1);
   printf("\n%s\n",s[res1*2]);
   printf("\n%s\n",s[(res1*2)+1]);
}

void f2()
{
   buff[res2][0]='9';
     buff[res2][3]='9';

  int j=0,k=0;
  while(j<=3)
  {
  if(buff[res2][j]!='9')
  {
 fstr1[k]=buff[res2][j];
    k++;
  }
    j++;
  }
  fstr1[k]='\0';
  buff2=fstr1;
  // printf("\n%s\n",str2);
    // printf("\n%s\n",buff2);
 printf("\n%s\n",s[res2*2]);
   printf("\n%s\n",s[(res2*2)+1]);
}

void f3()
{
   buff[res3][0]='9';
     buff[res3][2]='9';
  int j=0,k=0;
  while(j<=3)
  {
  if(buff[res3][j]!='9')
  {
 fstr2[k]=buff[res3][j];
   k++;
  }
    j++;
  }
  fstr2[k]='\0';
  buff3=fstr2;
  //  printf("\n%s\n",str3);
   //  printf("\n%s\n",buff3);
 printf("\n%s\n",s[res3*2]);
   printf("\n%s\n",s[(res3*2)+1]);
}

void f4()
{
 buff[res4][0]='9';
  int j=0,k=0;
  while(j<=3)
  {
  if(buff[res4][j]!='9')
  {
 fstr3[k]=buff[res4][j];
 k++;
  }
    j++;
  }
  fstr3[k]='\0';
  buff4=fstr3;
 //   printf("\n%s\n",str4);
   //  printf("\n%s\n",buff4);
      printf("\n%s\n",s[res4*2]);
   printf("\n%s\n",s[(res4*2)+1]);

 }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -