Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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++ÖеÄSplitº¯Êý

 C/C++ÖеÄSplitº¯ÊýÊÇstrtok()Æ亯ÊýÔ­ÐÍÈçÏÂ:
char * strtok (char * str, const char * delimiters);
º¯Êý˵Ã÷
strtok()ÓÃÀ´½«×Ö·û´®·Ö¸î³ÉÒ»¸ö¸öƬ¶Î¡£²ÎÊýstrÖ¸ÏòÓû·Ö¸îµÄ×Ö·û´®£¬²ÎÊýdelimitersÔòΪ·Ö¸î×Ö·û´®£¬µ±strtok()ÔÚ²ÎÊý
strµÄ×Ö·û´®Öз¢ÏÖµ½²ÎÊýdelimitersµÄ·Ö¸î×Ö·ûʱÔò»á½«¸Ã×Ö·û¸ÄΪ'\0'×Ö·û ......

C_תÒå×Ö·û

 Ô´Âë:
# include <stdio.h>
 
int main()
{
    /* »»Ðзû'\n'£¬ÓÃÓÚÊä³ö»»ÐÐ */
    printf("How are you?\n");
    printf("I am fine.\n\n");
 
    /* ºáÏòÌø¸ñ·û'\t'£¬Ê¹Ìøµ½ÏÂÒ»¸öÊä³öÇø */
  ......

C_¹ØϵºÍÂß¼­ÔËËã

 Ô´Âë:
# include <stdio.h>
 
int main()
{
    /* ¶¨ÒåÒ»¸öÕûÊýÀàÐ͵ıäÁ¿£¬ÓÃÀ´´æ·ÅºóÃæËãʽµÄÖµ */
    int logic;    
 
    int a = 1;
    int b = 2;
    int c = 3;
 
&n ......

C_¸÷ÖÖÊý×éµÄ³õʼ»¯ÊµÀý

 Ô´Â룺
# include <stdio.h>
 
int main()
{
    /* Óгߴç */
    /* һάÕûÐÎÊý×é³õʼ»¯ */
    int  array1[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
 
    /* һά×Ö·ûÐÍÊý×é³õʼ»¯£¬×îºóÒ»¸öÔªËØ×Ô¶¯Ìí¼ÓΪ‘/0 ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ