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ÓïÑÔÎļþ²Ù×÷½Ó´¥ºÜ¾ÃÁË£¬Ò»Ö±Ã»ÓÐ×ܽáÏà¹ØÄÚÈÝ£¬½ñÌìÓõ½Á˾ÍÈ¥ÕÒÁËÕÒÏà¹ØÄÚÈÝ¡£
ÔÚANSI CÖУ¬¶ÔÎļþµÄ²Ù×÷·ÖΪÁ½ÖÖ·½Ê½£¬¼´Á÷ʽÎļþ²Ù×÷ºÍI/OÎļþ²Ù×÷
typedef struct {
int level; /* fill/empty level of buffer */
unsigned flags; /* File status flags */
char fd; /* File descriptor */
unsigned char hold ......
´ÓСÀÏʦ¾Í½Ìµ¼ÎÒÃÇ£¬²»»á×öµÄÌâ¾ÍÑ¡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 ......
Python 3 Êä³öÖض¨ÏòʹÓÃC/C++
By:gddsky
Ä¿±ê
Ï£Íû½«Python 3µÄÊä³öÖض¨Ïòµ½×Ô¶¨ÒåµÄÊä³öÄ¿±ê¡£
ºËÐÄ
PythonʹÓÃsys.stdout¡¢sys.stderr×öÊä³öÄ¿±ê£¬Ö»ÒªÎÒÃÇÌæ»»ÕâÁ½¸öÖµ¾Í¿ÉÒÔÖض¨Ïòµ½ÎÒÃÇ×Ô¶¨ÒåÄ¿±ê¡£Ìæ»»µÄÖµµÄ¹æÔòÔÚPythonµÄÎĵµÖÐsys (module)µÄsys.stdoutÉÏÃæ˵Ã÷Ö»ÒªÌí¼ÓÒ»¸öwriteº¯Êý¾Í¿ÉÒÔ ......
Ö¸ÕëÊÇÒ»¸öÌØÊâµÄ±äÁ¿£¬ËüÀïÃæ´æ´¢µÄÊýÖµ±»½âÊͳÉΪÄÚ´æÀïµÄÒ»¸öµØÖ·¡£ Òª¸ãÇåÒ»¸öÖ¸ÕëÐèÒª¸ãÇåÖ¸ÕëµÄËÄ·½ÃæµÄÄÚÈÝ£ºÖ¸ÕëµÄÀàÐÍ£¬Ö¸ÕëËùÖ¸ÏòµÄ ÀàÐÍ£¬Ö¸ÕëµÄÖµ»òÕß½ÐÖ¸ÕëËùÖ¸ÏòµÄÄÚ´æÇø£¬»¹ÓÐÖ¸Õë±¾ÉíËùÕ¼¾ÝµÄÄÚ´æÇø¡£ÈÃÎÒÃÇ·Ö±ð˵Ã÷¡£
¡¡¡¡ÏÈÉùÃ÷¼¸¸öÖ¸Õë·Å×Å×öÀý×Ó£º ......