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

C_ÔËÓÃdo

 Ô´Â룺
# include <math.h>
# include <stdio.h>    /* Êýѧº¯Êý¿â */
 
int main()
{
    /* ÓÃs±íʾ¶àÏîʽµÄÖµ£¬ÓÃt±íʾÿһÏîµÄÖµ */
    double s, t, x; // ´Ë´¦ÓÃË«¾«¶ÈÉùÃ÷±äÁ¿
    int n;
    printf("please input x: ");
    scanf("%lf", &x); // £¥lf ´ú±íÓÃË«¾«¶ÈÊäÈë
    /* ¸³³õÖµ */
    t = x;
    n = 1;
    s = x;
    /* ½øÐеþ¼ÓÔËËã */
    do
    {
        n = n + 2 ;
        t = t * (-x*x)/((float)(n)-1)/(float)(n);
        s = s + t;
    } while (fabs(t)>=1e-8); // ±¾À´ÊÇÒª´óÓÚ0,µ«Ò²¿É´óÓÚÒ»¸öºÜСµÄÊý¼´¿É
    printf("sin(%f) = %lf\n", x, s);
    return 0;
}


Ïà¹ØÎĵµ£º

B/S C/S½á¹¹¶¨ÒåµÄÏê½âºÍÇø±ð

 b/s ÊÇ brower/server ¾ÍÊÇÓÃä¯ÀÀÆ÷(Èçie)ΪӦÓóÌÐò¿Í»§¶Ë²Ù×÷·þÎñÆ÷¡£ÕâÑùÓÃä¯ÀÀÆ÷À´²Ù×÷¼òµ¥Ò×Ó㬵«ÊǶÔÊäÈëûÓкܺõÄÑéÖ¤¡£Âß¼­ÊµÏÖ²»¶à¡£±¾µØÖ»ÊÇÓÃÓÚ»ñÈ¡Êý¾ÝÈ»ºó´ó²¿·ÖÑéÖ¤ÐèÒªÌá½»·þÎñÆ÷À´Íê³É¡£
c/s ÊÇclient/server ¿Í»§¶ËÈí¼þÔòÊÇÒ»¸öÓµÓкܶàÂß¼­ÑéÖ¤µÄÈí¼þ£¬±¾µØÑéÖ¤³É¹¦ºó²ÅÌá½»·þÎñÆ÷¡£
ÎÒÕÒµ½µÄ¸ ......

cÄÚ´æ·ÖÅä

ÄÚ´æ·ÖÅ䷽ʽÓÐÈýÖÖ£º
£¨1£© ´Ó¾²Ì¬´æ´¢ÇøÓò·ÖÅä¡£ÄÚ´æÔÚ³ÌÐò±àÒëµÄʱºò¾ÍÒѾ­·ÖÅäºÃ£¬Õâ¿éÄÚ´æÔÚ³ÌÐòµÄ
Õû¸öÔËÐÐÆÚ¼ä¶¼´æÔÚ¡£ÀýÈçÈ«¾Ö±äÁ¿£¬static ±äÁ¿¡£
£¨2£© ÔÚÕ»ÉÏ´´½¨¡£ÔÚÖ´Ðк¯Êýʱ£¬º¯ÊýÄÚ¾Ö²¿±äÁ¿µÄ´æ´¢µ¥Ôª¶¼¿ÉÒÔÔÚÕ»ÉÏ´´½¨£¬º¯
ÊýÖ´ÐнáÊøÊ±ÕâЩ´æ´¢µ¥Ôª×Ô¶¯±»ÊÍ·Å¡£Õ»ÄÚ´æ·ÖÅäÔËËãÄÚÖÃÓÚ´¦ÀíÆ÷µÄÖ¸Áî¼ ......

C/C++ʱ¼äº¯ÊýʹÓ÷½·¨£¨×ª£©

C++¶Ôʱ¼äµÄ²Ù×÷Ò²ÓÐÐí¶àÖµµÃ´ó¼Ò×¢ÒâµÄµØ·½¡£×î½ü£¬ÔÚ¼¼ÊõȺÖÐÓкܶàÍøÓÑÒ²¶à´ÎÎʵ½¹ýC++ÓïÑÔÖжÔʱ¼äµÄ²Ù×÷¡¢»ñÈ¡ºÍÏÔʾµÈµÈµÄÎÊÌâ¡£ÏÂÃæ£¬ÔÚÕâÆªÎÄÕÂÖУ¬±ÊÕß½«Ö÷Òª½éÉÜÔÚC/C++ÖÐʱ¼äºÍÈÕÆÚµÄʹÓ÷½·¨.
         ͨ¹ýѧϰÐí¶àC/C++¿â£¬Äã¿ÉÒÔÓкܶà²Ù×÷¡¢Ê¹ÓÃʱ¼äµÄ·½·¨¡£µ«Ô ......

C_ʹÓÃforÑ­»·»­ÁâÐÎ

 Ô´Âë:
# include <stdio.h>
 
int main()
{
    int i, j, k;
     
    /* ±äÁ¿i´Ó0µ½4£¬±íʾËù»­ÁâÐÎͼµÄµÚÒ»ÖÁµÚÎåÐÐ */
    for(i = 0; i <= 4; i++)
    {
        /* ......

C_ʹÓÃwhileÓï¾äÇóÁ½ÕûÊýµÄ×îС¹«±¶ÊýÓë×î´ó¹«Ô¼Êý

 Ô´Âë:
# include <stdio.h>
 
int main()
{
    int x, y, num1, num2, temp;
    printf("ÇëÊäÈëÁ½¸öÕýÕûÊý£º\n");
    scanf("%d %d", &num1, &num2);
 
    if(num1 < num2)
   ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ