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

C_×ÛºÏʹÓÃÊý×éʵÏÖ¼òµ¥µÄѧÉú³É¼¨¹ÜÀíϵͳ

 Ô´Â룺
/* ѧÉú³É¼¨²éѯϵͳ */
# include <stdio.h>
# include <stdlib.h>
 
int main( )
{
    int select;
    int i, j;
    int score[5][7];
    int average = 0;
    int sum = 0;
    do{
        printf("±¾³ÌÐòÓÐ4ÏÄÜ£º\n");
        printf(" 1. ¸ù¾ÝѧºÅ²éѯѧÉú³É¼¨\n");
        printf(" 2. ¸ù¾Ý¿¼ÊÔºÅͳ¼Æ³É¼¨\n") ;
        printf(" 3. ¸ù¾Ý¿¼ÊԺźÍѧºÅ²éѯ³É¼¨\n");
        printf(" 4. ³É¼¨Â¼Èë\n");
        printf(" 0. Í˳ö\n");
        printf(" ÇëÊäÈëÑ¡Ôñ(0 - 4): ");
        scanf("%d", &select);
        switch(select)
        {
        case 0:
            printf("Good-Bye~\n");
            exit(0);
            break;
        case 1:
            printf("ÊäÈëѧºÅ£º"); // ¸ù¾Ýiֵȷ¶¨Ñ§ºÅ£¬È»ºó°´Ñ§ºÅÊä³öÈ«²¿³É¼¨
            scanf("%d\n", &i);
            for(j=1; j<7; j++)
            {
                printf("µÚ%d¿Æ³É¼¨ÊÇ%d\n", j, score[i][j]);
                sum += score[i][j];  // ʵÏÖÀÛ¼Ó
    &nb


Ïà¹ØÎĵµ£º

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

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

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

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

C_×ÔÔöÓë×Ô¼õ

 Ô´Âë:
# include <stdio.h>
 
int main()
{
    int i, j, k;
    int m, n, p;
 
    i = 8;
    j = 10;
    k = 12;
    
    /* ×ÔÔöÔÚ²Ù×÷Êý֮ǰ */
   ......

C_ʹÓÃswitchÓï¾ä

 Ô´Âë:
# include <stdio.h>
 
int main()
{
    int num;
    /* ÏÂÃæ¶¨ÒåµÄ¸÷±äÁ¿£¬·Ö±ð´ú±í¸öλ£¬Ê®Î»£¬°Ùλ£¬Ç§Î»£¬Íòλ£¬Ê®ÍòλÒÔ¼°Î»Êý */
    int indiv, ten, hundred, thousand; 
    int ten_thousand, hundred_thous ......

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

 Ô´Â룺
# include <stdio.h>
 
int main( )
{
    int radius;
    double area;
    for(radius = 1; radius <= 10 ; radius++)
    {
        area = 3.1416 * radius * radius;
   ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ