¶Á¡¶c³ÌÐòÉè¼ÆÓïÑÔ¡·Ò»Ð©¸ÐÊÜ
×î½üÔÚ¿´¡¶c³ÌÐòÉè¼ÆÓïÑÔ¡·£¬¾ÍÊÇÄDZ¾±»ÓþΪCÓïÑÔÊ¥¾µÄÊé¼®¡£¼¸Ìì¿´ÁËÒ»Õ£¬¸Ð´¥ºÜ´ó£¬¿ªÆª¾ÍÉæ¼°µ½ºÜ¶àʵÓóÌÐò£¬²»ÏñÌ·ºÆÇ¿ÄÇÑùÈÃÈËÉîÏÝÓ﷨ϸ½ÚÖ®ÖУ¬¶øÇÒѧÍêÌ·µÄÊé¸Ð¾õʲô¶¼²»ÄÜ×ö¡£ºÜ¶àÎÊÌâÌ·¶¼»Ø±ÜÁË¡£Ëùνרҵ¿´¿´c³ÌÐòÉè¼ÆÓïÑԵĴúÂëµÄ·ç¸ñ¾ÍÄܸÐÊܵ½£¬Ò»ÖÖ¾«Ðĵñ×ÁµÄÒÕÊõÆ·¡£µÚÒ»ÕÂÓÐÒ»¸ö¼òµ¥µÄÎÊÌ⣬¾ÍÊÇ°Ñ×Ö·û´®Óжà¸ö¿Õ¸ñµÄÓÃÒ»¸ö¿Õ¸ñ´úÌ棬×Ô¼ºÐ´ÁËÒ»ÖÖ£¬ºóÀ´¿´Á˴𰸣¬¸Ð¾õ×Ô¼ºÆäʵ°Ñ¼òµ¥µÄÎÊÌ⸴ÔÓ»¯ÁË£¬Õâ»òÐí¾ÍÊÇ´óÅ£ÓëÎÒÕâÑù²ËÄñµÄ²î±ð¡£ÏÂÃæÊÇÎÒ×Ô¼ºµÄ³ÌÐò.#include<stdio.h>
int main(void)
{
int c;
int count;
while((c=getchar())!=EOF)
{
if(c==' ') count++;
else
{
putchar(c);
count==0;
}
if(count==1) putchar(' ');
}
}
Ïà¹ØÎĵµ£º
.hÖÐÒ»°ã·ÅµÄÊÇͬÃû.cÎļþÖж¨ÒåµÄ±äÁ¿¡¢Êý×é¡¢º¯ÊýµÄÉùÃ÷£¬ÐèÒªÈÃ.cÍⲿʹÓõÄÉùÃ÷¡£
1)hÎļþ×÷ÓÃ
1 ·½±ã¿ª·¢:°üº¬Ò»Ð©ÎļþÐèÒªµÄ¹²Í¬µÄ³£Á¿,½á¹¹,ÀàÐͶ¨Òå,º¯Êý,±äÁ¿ÉêÃ÷£»
2 Ìṩ½Ó¿Ú:¶ÔÒ»¸öÈí¼þ°üÀ´Ëµ¿ÉÒÔÌṩһ¸ö¸øÍâ½çµÄ½Ó¿Ú(ÀýÈç: stdio.h)¡£
2)hÎļþÀïÓ¦¸ÃÓÐʲô
³£Á¿,½á¹¹,ÀàÐ ......
/*
title£ºÔ¼Éª·òÎÊÌâµÄÑ»·Á´±í½â·¨
author£ºcoolsky600
date£º2010 04 22
notice£ºcÓïÑÔ ÃæÏò¹ý³Ì
*/
#include<stdio.h>
#include<stdlib.h>
#include<conio.h>
int num; //È«¾Ö±äÁ¿Î§È¦ÈËÊý
int out; & ......
/*
============================================================================
Name : test.c
Author : alf
Version :
Copyright : Your copyright notice
  ......
×î½ü¶Ô»ù´¡ÖªÊ¶½øÐÐÁËѧϰ£¬·¢ÏÖÒÔÇ°ºÜ¶à¶«Î÷¶¼Ã»ÓиãÇå³þ
1. ±àÒëµÄÎÊÌ⣬ͷÎļþÖ÷ÒªÊǶ¨Òå
//////// add.c
int add(int a, int b)
{
return a + b;
}
///////// main.c
#include <stdio.h>
int add(int a, int b);
int main ()
{
printf("%d" ......