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

C_ʹÓÃbreakºÍcontinue¿ØÖÆÑ­»·Óï¾ä

 Ô´Â룺
# include <stdio.h>
 
int main( )
{
    int radius;
    double area;
    for(radius = 1; radius <= 10 ; radius++)
    {
        area = 3.1416 * radius * radius;
        /* ÈôÔ²Ãæ»ý³¬¹ý120£¬ÔòÌø³öforÑ­»·£¬²»ÓèÊä³ö */
        if(area >= 120.0)
            break;  // Ìø³öÑ­»·
        printf("square = %f\n", area);
    }
    printf("now radius=%d\n\n", radius-1);
 
    for(radius = 1; radius <= 10 ; radius++)
    {
        area = 3.1416 * radius * radius;
        /* ÈôÔ²Ãæ»ýûÓг¬¹ý60£¬Ôò²»Êä³ö¶øÊÇ´ÓпªÊ¼Ñ­»· */
        if(area < 120.0)
            continue;  // »Øµ½Ñ­»·Í·²¿,¼ÌÐøÏÂһѭ»·
        printf("square = %f\n", area);
    }
    printf("now radius=%d\n", radius-1);
    return 0;
}


Ïà¹ØÎĵµ£º

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

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

C ¶Á100¸öÊýµ½Êý×é

 #include <stdio.h>
#define MAX 100
int a[MAX], b[MAX], count = 0;
void rData()
{ int i;
FILE *fp;
fp = fopen("C:\\100.dat", "r");
for (i=0; i<MAX; i++)
fscanf(fp, "%d,", &a[i]);
fclose(fp);
}
 
void main()
{ int i;
rData();
//printf("Âú×ãÌõ¼þµÄÊý= ......

C/C++ÖеÄÈÕÆÚºÍʱ¼ä time_tÓëstruct tmת»»

 ÕªÒª£º
±¾ÎÄ´Ó½éÉÜ»ù´¡¸ÅÄîÈëÊÖ£¬Ì½ÌÖÁËÔÚC/C++ÖжÔÈÕÆÚºÍʱ¼ä²Ù×÷ËùÓõ½µÄÊý¾Ý½á¹¹ºÍº¯Êý£¬²¢¶Ô¼Æʱ¡¢Ê±¼äµÄ»ñÈ¡¡¢Ê±¼äµÄ¼ÆËãºÍÏÔʾ¸ñʽµÈ·½Ãæ½øÐÐÁ˲ûÊö¡£±¾ÎÄ»¹Í¨¹ý´óÁ¿µÄʵÀýÏòÄãչʾÁËtime.hÍ·ÎļþÖÐÉùÃ÷µÄ¸÷ÖÖº¯ÊýºÍÊý¾Ý½á¹¹µÄÏêϸʹÓ÷½·¨¡£
¹Ø¼ü×Ö£ºUTC£¨ÊÀ½ç±ê׼ʱ¼ä£©£¬Calendar Time£¨ÈÕÀúʱ¼ä£©£¬epoch ......

C_ÆÕͨλÔËËã

 Ô´Âë:
# include <stdio.h>
 
int main()
{
    /* ¶¨ÒåÁËÒ»¸öÎÞ·ûºÅ×Ö·ûÐͱäÁ¿£¬´Ë±äÁ¿Ö»ÄÜÓÃÀ´´æ´¢ÎÞ·ûºÅÊý */
    unsigned char result;
    
    int a, b, c, d;
    a = 2;
    b = 4; ......

C_ÅжÏÓï¾äifÓëelseµÄǶÌ×ʹÓÃ

 Ô´Âë:
# include <stdio.h>
 
int main()
{
    /* sex´ú±íÊäѪÕßµÄÐÔ±ð£¬weight´ú±íÊäѪÕßµÄÌåÖØ£¬cubage´ú±íÊäѪÁ¿ */
    int sex, weight, cubage;
    printf("Çë¸ø³öÊäѪÕßµÄÐÔ±ð£¨Å®ÐÔΪ¸ºÊý£©ºÍÌåÖØ£º(ÓöººÅ¸ô¿ª)");
 &nbs ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ