±ïÁËÒ»Ì죬×îÖÕд³öÀ´Á˵ÄÇó×î´ó¹«Ô¼ÊýµÄ³ÌÐò£¨C£©
Ç°ÌìÍíÉÏÓöµ½Ò»Ì⣬±àд³ÌÐòÇó³ö×î´ó¹«ÒòÊý£¨×î´ó¹«Ô¼Êý£©£¬±¾ÄܵÄÎÒÏëÆðÀ´ÁËÊýѧÖÐÇó×î´ó¹«ÒòʽµÄ·½·¨£¬¿ÉÊÇÔÚ³ÌÐòʵ¼ùÉÏ
Ã÷ÏԵijöÁËÎÊÌ⣬Á½¸öÊýÒªÒ»¸öÒ»¸öµÄ½øÐвð½â£¬È»ºóÕÒµ½ÏàͬµÄ£¬Õâ¸ù±¾ÊÇÒ»ÌõËÀ·£¬Ë¼Ë÷Ò»Ò¹ÐÑÀ´£¬Í»È»±Å·¢Áé¸Ð£¬¿ÉÒÔ
ÓÃÁ½¸öÊý½øÐÐÈ¡ÓàÔËË㣬Èç¹ûÓàÊýΪÁãÔò×î´ó¹«ÒòÊýΪ±»³ýÊý£¬²»ÎªÁãÔòÓàÊýΪ×î´ó¹«Ô¼Êý£¬¶÷£¬¾ÍÊÇÕâ¸ö˼·£¬¼òµ¥µÄÊý¾Ý»¹ÐУ¬µ«ÊÇÓöµ½15ºÍ25Ö®ºó¾Í³öÏÖÁËÎÊÌ⣬°´ÉÏÃæ˼·ÄÇô¹«Ô¼ÊýΪ10£¬¿ÉÊÇʵ¼ÊΪ5£¬¼ÌÐø˼¿¼£¬¿ÉÒÔÓÃ15¶Ô10½øÐÐÈ¡Ó࣬yes£¡¾ÍÊÇÕâÃÇ°ì¡£
µ«ÊÇÎÊÌâÓÖ³öÏÖÁË£¬Á½´Î¿ÉÒÔÈý´ÎÄØ£¿ÎÒ¸ù±¾ÎÞ·¨Ô¤Öªµ½µ×ÒªÓü¸´Î£¬ËùÒÔ¼Ó¸öÑ»·¡£ok¡£
ÕâÊÇÒ»ÌõÂþ³¤µÄ¹ý³Ì£¬ÎÒµÄʱ¼äºÄ·ÑÔÚÄǸöÉÏÃæÁË¡£ËùÒÔ¸½¼ÓÎҵijÌÐòÒÔ±í£º
/**************************************************
* Name: gcd.c
* Purpose: Great comman divisor
* Author: zimo
* Date: 01/23/2010
* ***********************************************/
#include<stdio.h>
int main(void)
{
int divisor, dividend, result;
printf("Enter two integers:");
scanf("%d, %d", &divisor, ÷nd);
if(divisor == 0)
{
printf("Greatest common divisor: %d \n",dividend);
}
else if(dividend == 0)
{
printf("Geratest common divisor: %d \n", divisor);
}
else if(divisor >= dividend)
{
while(divisor % dividend != 0)
{
result = divisor % dividend;
&nbs
Ïà¹ØÎĵµ£º
ÕâÀïÊÕ¼¯Ò»Ð©CÓïÑÔʹÓÃÖеĸ߼¶¼¼ÇÉ£¬ÕâЩ¼¼Çɶ¼ÊÇһЩ»ù±¾Óï·¨µÄÇÉÃîʹÓ㬵«ÊÇÊ״ο´µ½ÕâÑùµÄÓ÷¨»á¸Ð¾õÑÛ»¨çÔÂÒ¡£
Ò»¡¢mainº¯ÊýµÄ·â×°
ÔÚһЩ¿âÖУ¬ÎªÁ˼¯³É¶È¸ü¸ß£¬ÍùÍù»á°Ñmainº¯Êý·â×°µ½¿âÖУ¬¶øÌṩ¸øÓû§Ê¹ÓõÄÊÇÁíÒ»¸ö×Ô¶¨Ò庯Êý£¬Õâʱºò¾Í»áÓõ½mainº¯ÊýµÄ·â×°ÁË£¬ÕâÀïʹÓõÄÊǺ궨ÒåµÄ¼¼ÇÉ£º
#define MyMain ......
Ç°ÃæÁ½Æª»ù±¾°ÑÖ¸Õë¸ø½éÉÜÍêÁË£¬ÏàÐÅ´ó¼Ò¶ÔÖ¸ÕëÒѾ²»ÊÇÄÇôİÉúÁË¡£Ò²²»»áÒòΪָÕëºÍÊý×éÖ®¼äµÄ¹Øϵ¶øµ¼Ö»ìÏýÁË¡£´ó¼Ò¿ÉÄÜÒ²ÆȲ»¼°´ýÏëÁ˽âϺóÀ´µÄ֪ʶ¡£½ñÌìÎÒÃǾͽéÉÜϽṹÌå¡£
¶ÔÓڽṹÌ壬¼ÈÈ»½Ð½á¹¹Ì壬ÐÎÏóÉÏÎÒÃÇ¿ÉÒÔÀí½âÆä¾ÍÊÇÒ»¶ÑÊý¾Ý¼¯ºÏÔÚÒ»ÆðÐγÉÒ»¸ö½á¹¹¡£¾Í±ÈÈçÒ»¸öѧÉúµÄÐÅÏ¢°üÀ¨£ºÑ§ºÅ¡¢ÐÕÃû¡¢°à¼¶¡¢Äê ......
ǰһƪÎÒÃǽéÉÜÁËÒ»¸ö¼òµ¥²»¹ýµÄhelloworld³ÌÐòÒý³öÏà¹ØÎÊÌâ¡£³Ã×Å»¹Ã»ÓÐÍüµôÄÇЩ˼¿¼·½Ê½µÄ¼ÇÒ䣬±¾Æª¼ÌÐøÑÓÐøÕâÖÖ˼ά·½Ê½µÄÀíÄ½éÉÜÒ»ÏÂCC++ÖеĻù±¾Êý¾ÝÀàÐÍ¡£Êý¾ÝÀàÐͲ»Çå³þµÄ»°ÔÚÒÔºóµÄ±à³ÌÖлáÓкܶàÃÕÍźÍÎÊÌâ¡£ÉõÖÁÒ»¸ö³ÌÐòµÄBUGÕÒ°ëÌìҲûÓÐÕÒ³öÀ´Ê±ÎªÊ²Ã´£¬½á¹û²Å·¢ÏÖÊǼӼõÒç³öÁË¡£¸ü¼ÓÑÏÖصĻ¹ÓÐдԽ½ç¡¢¶ÁÔ ......
֮ǰµÄ¶¨Î»¿ÉÄÜÖ÷ҪΪÁËÑо¿µ×²ã¼°Ò»Ð©½Ï¸´ÔÓµÄÎÊÌâÉÏ£¬¶øºöÂÔÁËһЩ³õѧµÄÅóÓÑ¡£µ¼ÖÂËûÃÇ¿ÉÄÜÒ»½øÀ´¾ÍÓеã“Íû¶øÉúη”µÄ¸Ð¾õ£¨×ÔÚ¼Á˹þ£¬ÅÄש£¡£©¡£Ó¦¹ÖÊÞȺÀïÐֵܼ°Ò»Ð©ÅóÓѵĽ¨Ò飬ͬʱҲΪÁË°Ñ×Ô¼ºµÄ¾Ñé¼°±à³Ì·½ÃæµÄһЩÏë·¨·ÖÏí¸ø´ó¼Ò¡£Òò´Ë´òËãдһЩCC++ÓïÑÔ»ù´¡ÈëÃŵIJ©ÎÄ¡£
´Ó±¾Ä£¿éÖУ¬´ó¼Ò¿ÉÒÔÁ˽â ......
×î½üÓÐÕâô¸öÐèÇó,
c¸ã¸ãÕýÔò,
±Ï¾¹Regular Expression soÇ¿´ó^_^
±ê×¼µÄCºÍC+
+
¶¼²»Ö§³ÖÕýÔò±í´ïʽ£¬µ«ÓÐһЩº¯Êý¿â¿ÉÒÔ¸¨ÖúC/
C+
+
³ÌÐòÔ±Íê³ÉÕâÒ»¹¦ÄÜ£¬ÆäÖÐ×îÖøÃûµÄµ±ÊýPhilip HazelµÄPerl-
Compatible Regular Expression¿â£¬Ðí¶àLinux·¢Ðа汾¶¼´øÓÐÕâ¸öº¯Êý¿â¡£
±àÒëÕýÔò±í´ïʽ
ΪÁËÌá¸ßЧÂÊ£¬ÔÚ½«Ò»¸ö× ......