Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

c³ÌÐòÉè¼ÆÓïÑÔ¹Ù·½Ìâ½â°æ¿±Îó1

#include <stdio.h>
#define MAXHIST 15
#define MAXWORD 11
#define IN  1
#define OUT  0
//´òÓ¡ÊäÈëÖе¥´Ê³¤¶ÈµÄˮƽ·½ÏòÖ±·½Í¼£¬
void main()
{
 int c, i, nc, state;
 int len;     //length of each bar
 int maxvalue;    //maximum value for wl[]
 int ovflow;     //number of overflow words
 int wl[MAXWORD];   //word length count
 
 state = OUT;
 nc = 0;                     //number of chars in a word
 ovflow = 0;
 for (i = 0; i < MAXWORD; ++i)//Êý×é³õʼ»¯
  wl[i] = 0;
 
 
 while((c = getchar()) != EOF){
  if (c == ' ' || c == '\n' || c == '\t'){
   state = OUT;
   if(nc > 0)
    if(nc < MAXWORD)
     ++wl[nc];
    else
     ++ovflow;
   nc = 0;
  }else if (state == OUT){
   state = IN;
   nc = 1;
  }else
   ++nc;
 }
 
  maxvalue = 0;
 for (i = 1; i < MAXWORD; ++i)
  if (wl[i] > maxvalue)
   maxvalue = wl[i];
  
 for (i = 1; i < MAXWORD; ++i){
  printf("%5d - %d : ",i, wl[i]);
  if(wl[i] > 0) {
     if((len * wl[i] * MAXHIST / maxvalue) <= 0)
    len = wl[i];//ÊéÉÏ´Ë´¦±¾À´Îªlen = 1
  }else
   len = 0;
  while (len > 0){
   putchar('*');
   --len;
  }
  putchar('\n');
 }
 if (ovflow > 0)
  printf("There are %d words >= %d\n", ovflow, MAXWORD);
  }


Ïà¹ØÎĵµ£º

CÓïÑÔ»ù±¾¹¦½Ì³ÌϵÁÐ(3) ¿ìËٵĺ¯Êýµ÷ÓÃ

CÓïÑÔ»ù±¾¹¦½Ì³ÌϵÁÐ(3) - ¿ìËٵĺ¯Êýµ÷ÓÃ
ÎÒÓÖÀ´ÁË£¬½ñÌ쿲¿²º¯Êýµ÷ÓõÄÎÊÌâ¡£º¯ÊýÄÄÀﶼÓУ¬Ð¡µÄ³ÌÐòÒ»Á½¸öº¯Êý£¬´óµÄ³ÌÐò³É°ÙÉÏǧ¸öº¯Êý¡£¼´Ê¹ÔÚÓÎÏ·µÄ¹Ø¼üÑ­»·ÖУ¬µ÷Óü¸Ê®¸öº¯ÊýÒ²ÊǺܳ£¼ûµÄ¡£ËùÒÔº¯Êýµ÷ÓôúÂëµÄÖÊÁ¿£¬Ôںܴó³Ì¶ÈÉÏÓ°Ïì×ÅÓÎÏ·µÄÖÊÁ¿¡£
»¹ÊÇÏÈ˵×î»ù±¾µÄ´úÂë·ç¸ñÎÊÌâ¡£Ê×ÏÈ£¬¶ÔÓÚº¯ÊýµÄ²ÎÊý£¨ÌرðÊÇ ......

CÓïÑԺ궨Òå¼¼Çɼ°×¢ÒâÎÊÌâ abstract

Ç°ÑÔ
ÔÚ±àд³ÌÐòµÄʱºò,ÎÒÃǾ­³£ÒªÓõ½ºê¶¨Òå,ºê¶¨ÒåµÄÒýÈëȷʵ´ó´óÌá¸ßÁ˳ÌÐòµÄ¿É¶ÁÐÔ,¿ÉÒÆÖ²ÐÔ,·½±ãά»¤.......Òò´ËƯÁÁµÄºê¶¨ÒåºÜÖØÒª.....ʹÓú궨ÒåÒ²ÊÇÓÐÒ»¶¨¼¼ÇɵÄ,ÏÂÃæÊǹØÓں궨ÒåµÄһЩºÃµÄ³£Óõķ½·¨,¾Ý˵ÊÇһЩ³ÉÊìµÄÈí¼þÖг£ÓõÄ....ÎÒÌôÁËһЩÎÒÃÇÄܹ»Àí½â¶øÇÒʵÓõãµÄ.... µ«ÊÇ,ʹÓú궨ÒåʱҲҪʮ·ÖСÐÄ,Ó ......

Ñ¡CµÄ¸ÅÂÊÕæµÄÊÇ×î¸ßµÄ£¡

´ÓСÀÏʦ¾Í½Ìµ¼ÎÒÃÇ£¬²»»á×öµÄÌâ¾ÍÑ¡C£¬ÒòΪѡÔñÌâÑ¡CµÄ¸ÅÂÊÊÇ×î¸ßµÄ¡£ÊÂʵÉÏÕæÊÇÈç´ËÂ𣿽ñÌìÎÒÍ»·¢ÆæÏ룬ÀûÓÃGoogle×öÁËÒ»¸öСʵÑ顣ͳ¼ÆÏÔʾ£¬´ð°¸Ñ¡CµÄÌâ¹ûÈ»ÊÇ×î¶àµÄ£¡ Results 1 - 10 of about 364,000 for "ÕâµÀÌâÑ¡A".
Results 1 - 10 of about 352,000 for "ÕâµÀÌâÑ¡B".
Results 1 - 10 of about 521,000 for ......

Ò»¸öLinuxÏÂCÏ̳߳صÄʵÏÖ

from:×ÞöεÄרÀ¸
    ʲôʱºòÐèÒª´´½¨Ï̳߳ØÄØ£¿¼òµ¥µÄ˵£¬Èç¹ûÒ»¸öÓ¦ÓÃÐèҪƵ·±µÄ´´½¨ºÍÏú»ÙỊ̈߳¬¶øÈÎÎñÖ´ÐеÄʱ¼äÓַdz£¶Ì£¬ÕâÑùÏ̴߳´½¨ºÍÏú»ÙµÄ´øÀ´µÄ¿ªÏú¾Í²»ÈݺöÊÓ£¬ÕâʱҲÊÇÏ̳߳ظóö³¡µÄ»ú»áÁË¡£Èç¹ûÏ̴߳´½¨ºÍÏú»Ùʱ¼äÏà±ÈÈÎÎñÖ´ÐÐʱ¼ä¿ÉÒÔºöÂÔ²»¼Æ£¬ÔòûÓбØҪʹÓÃÏ̳߳ØÁË¡£
  &n ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ