<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    BeautifulMan

      BlogJava :: 首頁 :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理 ::
      16 隨筆 :: 0 文章 :: 0 評論 :: 0 Trackbacks

    2015年10月28日 #

         摘要: 復(fù)習(xí)題1、將下列十進制數(shù)轉(zhuǎn)換為二進制形式:a. 3b. 13c. 59d. 119答:a. 11b. 1101c. 111011d. 11101112、將下列二進制值轉(zhuǎn)換為十進制、八進制和十六進制形式:a. 00010101b. 01010101c. 01001100d. 10011101答:a. 21, 025, 0x15b. 85, 0125, 0x55c. 76, 0114, 0x4Cd. ...  閱讀全文
    posted @ 2016-01-06 09:27 李阿昀 閱讀(483) | 評論 (0)編輯 收藏

    這是王爽老師的《匯編語言(第3版)》,經(jīng)知友推薦確實是一本極好的書!

    實驗4 [bx]和loop的使用
    (1)、(2)
    assume cs:code
    code segment
        mov ax,0020h
        mov ds,ax
        mov bx,0
        mov cx,64
      s:mov [bx],bl   ;這里必須是mov [bx],bl,而不能是mov [bx],bx,否則會出現(xiàn)類型不匹配
        inc bl
        loop s
        mov ax,4c00h
        int 21h
    code ends
    end









    posted @ 2015-12-15 09:06 李阿昀 閱讀(336) | 評論 (0)編輯 收藏

         摘要: 復(fù)習(xí)題1、以下模板有什么錯誤?Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->structure {    char itable;    int&nb...  閱讀全文
    posted @ 2015-12-10 16:53 李阿昀 閱讀(1572) | 評論 (0)編輯 收藏

         摘要: 書中的一個例子,我也是想了半天了!!!有點難度!!!Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->/* 把多個文件的內(nèi)容追加到一個文件中 */#include <stdio.h>#include &...  閱讀全文
    posted @ 2015-12-07 12:02 李阿昀 閱讀(1062) | 評論 (0)編輯 收藏

         摘要: 復(fù)習(xí)題1、哪一存儲類生成的變量對于包含他們的函數(shù)來說是局部變量?答:自動存儲類、寄存器存儲類和靜態(tài)空鏈接存儲類2、哪一存儲類的變量在包含它們的程序運行時期內(nèi)一直存在?答:靜態(tài)空鏈接存儲類、靜態(tài)內(nèi)部鏈接存儲類和靜態(tài)外部鏈接存儲類3、哪一存儲類的變量可以在多個文件中使用?哪一存儲類的變量只限于在一個文件中使用?答:靜態(tài)外部鏈接存儲類和靜態(tài)內(nèi)部鏈接存儲類4、代碼塊作用域變量具有哪種鏈接?答:空鏈接5、關(guān)...  閱讀全文
    posted @ 2015-12-04 20:03 李阿昀 閱讀(514) | 評論 (0)編輯 收藏

         摘要: 今天學(xué)到了一個新知識——選擇排序算法核心思想:(查找和放置)選擇剩余最大值的一個辦法就是比較剩余數(shù)組的第一和第二個元素。如果第二個元素大,就交換這兩個數(shù)據(jù)。現(xiàn)在比較第一個和第三個元素。如果第三個大,就交換這兩個數(shù)據(jù)。每次交換都把大的元素移到上面。繼續(xù)這種方法,直到比較第一個和最后一個元素。完成以后,最大的數(shù)就在剩余數(shù)組的第一個元素中。此時第一個元素已經(jīng)排好了序,但是數(shù)組中的...  閱讀全文
    posted @ 2015-11-30 09:47 李阿昀 閱讀(801) | 評論 (0)編輯 收藏

         摘要: 這一章感覺好難啊!!!學(xué)習(xí)筆記:(關(guān)于指針和多維數(shù)組)Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->// 多維數(shù)組和指針#include <stdio.h>int main(void){  ...  閱讀全文
    posted @ 2015-11-24 22:31 李阿昀 閱讀(857) | 評論 (0)編輯 收藏

    問題:編寫一個函數(shù)將一個整數(shù)轉(zhuǎn)換成二進制形式?(擴展請移步編程練習(xí)9)
    #include <stdio.h>
    void to_binary(unsigned long n);
    int main(void)
    {
        unsigned long number;
        printf("Enter an integer (q to quit): \n");
        while(scanf("%lu", &number) == 1)
        {
            printf("Binary equivalent: ");
            to_binary(number);
            putchar('\n');
            printf("Enter an integer (q to quit): \n");
        }
        printf("Done!\n");
        return 0;
    }
    void to_binary(unsigned long n)
    {
        int r;
        r = n % 2;
        if(n >= 2)
            to_binary(n / 2);
        putchar('0' + r);
        return;
    }
    復(fù)習(xí)題
    1、實際參數(shù)和形式參量有何不同?
    答:
    形式參量(也被稱為形式參數(shù))是一個變量,它在被調(diào)函數(shù)中進行定義。實際參數(shù)是在函數(shù)調(diào)用中出現(xiàn)的值,它被賦值給形式參量。可以把實際參數(shù)認(rèn)為是在函數(shù)被調(diào)用時用來初始化形式參量的值。
    2、寫出下面所描述的各個函數(shù)的ANSI函數(shù)頭。注意:只寫出函數(shù)頭即可,不需要實現(xiàn)。
    a.donut()接受一個int類型的參數(shù),然后輸出若干個0,輸出0的數(shù)目等于參數(shù)的值。
    b.gear()接受兩個int類型的參數(shù)并返回int類型的值。
    c.stuff_it()的參數(shù)包括一個double類型的值以及一個double類型變量的地址,功能是把第一個數(shù)值存放到指定的地址中。
    答:
    a.void donut(int n)
    b.int gear(int n, int m)
    c.void stuff_it(double n, double * d)
    3、只寫出下列函數(shù)的ANSI C函數(shù)頭,不需要實現(xiàn)函數(shù)。
    a.n_to_char()接受一個int類型的參數(shù)并返回一個char類型的值。
    b.digits()接受的參數(shù)是一個double類型的數(shù)值和一個int類型的數(shù)值,返回值類型是int。
    c.random()不接受參數(shù),返回int類型的數(shù)值。
    答:
    a.char n_to_char(int n)
    b.int digits(double n, int m)
    c.int random(void)
    4、設(shè)計一個實現(xiàn)兩整數(shù)相加并將結(jié)果返回的函數(shù)。
    答:
    int plus(int n, int m)
    {
        return n + m;
    }
    5、假如問題4中的函數(shù)實現(xiàn)兩個double類型的數(shù)值相加,那么應(yīng)該如何修改原函數(shù)?
    答:
    double plus(double n, double m)
    {
        return n + m;
    }
    6、設(shè)計函數(shù)alter(),其輸入?yún)?shù)是兩個int類型的變量x和y,功能是分別將這兩個變量的數(shù)值改為它們的和以及它們的差。
    答:(注意:下面這種寫法是錯誤的!!!)
    void alter(int x, int y)
    {
        x = x + y;
        y = x - y;
    }
    正確的寫法如下:
    void alter(int * u, int * v)
    {
        int temp;

        temp = *u;
        *u = *u + *v;
        *v = temp - *v;
    }
    7、判斷下面的函數(shù)定義是否正確。
    void salami(num)
    {
        int num, count;

        for(count = 1; count <= num; num++)
            printf("O salami mio!\n");
    }
    答:
    有錯誤。num應(yīng)該在salami()的參數(shù)列表中而不是在花括號之后聲明,而且應(yīng)該是count++而不是num++。
    8、編寫一個函數(shù),使其返回3個整數(shù)參數(shù)中的最大值。
    答:
    int max(int x, int y, int z)
    {
        int max;
        if(x > y)
            if(x > z)
                max = x;
            else
                max = z;
        else
            if(y > z)
                max = y;
            else
                max = z;
        return max;
    }
    or (更簡潔一點)
    int max(int x, int y, int z)
    {
        int max = x;
        if(y > max)
            max = y;
        if(z > max)
            max = z;
        return max;
    }
    9、給定下面的輸出:
    Please choose one of the following:
    1)copy files 2)move files
    3)remove files 4)quit
    Enter the number of your choice:
    a.用一個函數(shù)實現(xiàn)菜單的顯示,且該菜單有4個用數(shù)字編號的選項并要求你選擇其中之一(輸出應(yīng)該如題中所示)。
    b.編寫一個函數(shù),該函數(shù)接受兩個int類型的參數(shù):一個上界和一個下界。在函數(shù)中,首先從輸入終端讀取一個整數(shù),如果該整數(shù)不在上下界規(guī)定的范圍內(nèi),則函數(shù)重新顯示菜單(使用本題目a部分中的函數(shù))以再次提醒用戶輸入新值。如果輸入數(shù)值在規(guī)定的范圍內(nèi),那么函數(shù)應(yīng)該將數(shù)值返回給調(diào)用函數(shù)。
    c.使用本題目a和b部分中的函數(shù)編寫一個最小的程序。最小的意思是該程序不需要實現(xiàn)菜單中所描述的功能;它只需要顯示這些選項并能獲取正確的響應(yīng)即可。
    答:(參考課后答案)
    #include <stdio.h>
    void menu(void);
    int get_input(intint);
    int main(void)
    {
        int res;

        menu();
        while((res = get_input(1, 4)) != 4)
            printf("I like choice %d.\n", res);
        printf("Bye!\n");
        return 0;
    }
    void menu(void)
    {
        printf("Please choose one of the following: \n");
        printf("1)copy files          2)move files\n");
        printf("3)remove files        4)quit\n");
        printf("Enter the number of your choice: \n");
    }
    int get_input(int min, int max)
    {
        int number;

        scanf("%d", &number);
        while(number < min || number > max)
        {
            printf("%d is not a valid choice; try again.\n", number);
            menu();
            scanf("%d", &number);
        }
        return number;
    }
    編程練習(xí)
    1、
    #include <stdio.h>
    double min(doubledouble);
    int main(void)
    {
        printf("One of the smaller of the two numbers is %.2f", min(23.34, 12.11));
        return 0;
    }
    double min(double x, double y)
    {
        return x < y ? x : y;
    }
    2、
    #include <stdio.h>
    void chline(char ch, int i, int j);
    int main(void)
    {
        chline('$', 3, 5);
        return 0;
    }
    void chline(char ch, int i, int j)
    {
        int index;

        for(index = 1; index < i; index++)
            putchar(' ');
        for(index = 1; index <= j - i + 1; index++)
            putchar(ch);
    }
    3、
    #include <stdio.h>
    void chline(char ch, int col, int row);
    int main(void)
    {
        chline('$', 3, 5);
        return 0;
    }
    void chline(char ch, int col, int row)
    {
        int i, j;

        for(i = 0; i < row; i++)
        {
            for(j = 0; j < col; j++)
               putchar(ch);
            putchar('\n');
        }
    }
    4、
    #include <stdio.h>
    double computer(double a, double b);
    int main(void)
    {
        printf("%.2f和%.2f的諧均值是:%.3f\n", 0.3, 0.5, computer(0.3, 0.5));
        return 0;
    }
    double computer(double a, double b)
    {
        double result;

        result = 1 / ((1/a + 1/b) / 2);
        return result;
    }
    5、
    #include <stdio.h>
    void larger_of(double *, double *);
    int main(void)
    {
        double x = 23.3;
        double y = 34.4;
        printf("Originally x = %.1f; y = %.1f\n", x, y);
        larger_of(&x, &y);
        printf("Now x = %.1f; y = %.1f\n", x, y);
        return 0;
    }
    void larger_of(double * u, double * v)
    {
        double temp;
        temp = *u > *v ? *u : *v;
        *u = temp;
        *v = temp;
    }
    6、(第一次碼的程序讀取到換行符的時候也會打印出來,會給人看不明白的感覺,索性按[Enter]鍵的時候就退出循環(huán),不要讀到EOF)
    #include <stdio.h>
    #include <ctype.h>
    void printchar(char ch);
    int main(void)
    {
        char ch;

        printf("請輸入要分析的東西:\n");
        while((ch = getchar()) != EOF)
        {
            printchar(ch);
        }
        return 0;
    }
    void printchar(char ch)
    {
        if(isalpha(ch))
        {
            printf("%c %d\n", ch, toupper(ch) % 'A' + 1);
        }
    }
    修改之后,程序如下:
    #include <stdio.h>
    #include <ctype.h>
    int show_c_location(char ch);

    int main(void)
    {
        char ch;

        printf("Please enter some characters: \n");
        while((ch = getchar()) != '\n')
            printf("%c-%d ", ch, show_c_location(ch));
        return 0;
    }
    int show_c_location(char ch)
    {
        int result;

        if(isalpha(ch))
            result = toupper(ch) - 'A' + 1;
        else
            result = -1;
        return result;
    }
    7、
    #include <stdio.h>
    double power(double n, int p);
    int main(void)
    {
        double x, xpow;
        int exp;

        printf("Enter a number and the positive integer power");
        printf(" to which\nthe number will be raised. Enter q");
        printf(" to quit.\n");
        while(scanf("%lf%d", &x, &exp) == 2)
        {
            xpow = power(x, exp);
            printf("%.3g to power %d is %.5g\n", x, exp, xpow);
            printf("Enter next pair of numbers or q to quit.\n");
        }
        printf("Hope you enjoyed this power trip -- bye!\n");
        return 0;
    }
    double power(double n, int p)
    {
        int i;
        double result = 1;

        if(n != 0)
        {
            if(p > 0)
            {
                for(i = 1; i <= p; i++)
                    result *= n;
            }
            else if(p < 0)
            {
                for(i = 1; i <= -p; i++)
                    result *= (1 / n);
            }
            else
                result = 1;
        }
        else
        {
            if(p == 0)
                result = 1;// 0的0次方是一個有爭議的數(shù),本題認(rèn)為會得到1
            else
                result = 0;
        }
        return result;
    }
    8、
    #include <stdio.h>
    double power(double n, int p);
    int main(void)
    {
        double x, xpow;
        int exp;

        printf("Enter a number and the positive integer power");
        printf(" to which\nthe number will be raised. Enter q");
        printf(" to quit.\n");
        while(scanf("%lf%d", &x, &exp) == 2)
        {
            xpow = power(x, exp);
            printf("%.3g to power %d is %.5g\n", x, exp, xpow);
            printf("Enter next pair of numbers or q to quit.\n");
        }
        printf("Hope you enjoyed this power trip -- bye!\n");
        return 0;
    }
    double power(double n, int p)
    {
        double result = 1;

        if(n != 0)
        {
            if(p > 0)
                result = n * power(n, p-1);
            else if(p < 0)
                result = (1/n) * power(n, p+1);
            else
                result = 1;
        }
        else
        {
            if(p == 0)
                result = 1;// 0的0次方是一個有爭議的數(shù),本題認(rèn)為會得到1
            else
                result = 0;
        }
        return result;
    }
    9、
    #include <stdio.h>
    void to_base_n(unsigned long n, int range);
    int main(void)
    {
        unsigned long number;
        int range;
        printf("請輸入要轉(zhuǎn)換的無符號整數(shù)和所規(guī)定的進制數(shù): \n");
        while(scanf("%lu %d", &number, &range) == 2)
        {
            if(range >= 2 && range <= 10)
            {
                printf("無符號整數(shù)%lu轉(zhuǎn)換成%d進制數(shù)為: ", number, range);
                to_base_n(number, range);
                putchar('\n');
                printf("請輸入要轉(zhuǎn)換的無符號整數(shù)和所規(guī)定的進制數(shù): \n");
            }
            else
                printf("所規(guī)定的進制數(shù)的范圍是2~10,請輸入正確的數(shù)字\n");
        }
        printf("Done!\n");
        return 0;
    }
    void to_base_n(unsigned long n, int range)
    {
        int r;

        r = n % range;
        if(n >= range)
            to_base_n(n / range, range);
        putchar('0' + r);
        return;
    }
    10、(題意理解不清楚,借鑒CSDN——vs9841原作者的做法,腦子太笨,實在想不出來)
    #include <stdio.h>
    int Fibonacci(int n);
    int main(void)
    {
        int n = 9;
        printf("當(dāng)n為%d時,斐波納契數(shù)值為%d", n, Fibonacci(9));
        return 0;
    }
    int Fibonacci(int n)
    {
        int a, b, i;
        a = 0;
        b = 1;
        int sum;
        if(n == 0)
            return 0;
        if(n == 1)
            return 1;
        else
        {
            for(i = 2; i <= n; i++)
            {
                sum = a + b;
                a = b;
                b = sum;
            }
            return sum;
        }
    }
    總結(jié):總體來說編程練習(xí)相對以往來說要簡單了,但第10題沒明白什么意思,所以只能借鑒別人的了,真是天下文章一大抄!
    posted @ 2015-11-22 23:03 李阿昀 閱讀(1060) | 評論 (0)編輯 收藏

    復(fù)習(xí)題
    1、putchar(getchar())是一個有效的表達式,它實現(xiàn)什么功能?getchar(putchar())也有效嗎?
    答:
    語句putchar(getchar())使程序讀取下一個輸入字符并打印它,getchar()的返回值作為putchar()的參數(shù)。getchar(putchar())則不是合法的,因為getchar()不需要參數(shù)而putchar()需要一個參數(shù)。
    2、下面的每個語句實現(xiàn)什么功能?
        a.putchar('H');
        b.putchar('\007');
        c.putchar('\n');
        d.putchar('\b');
    答:
    a. 顯示字符H
    b.如果系統(tǒng)使用ASCII字符編碼,則發(fā)出一聲警報
    c.把光標(biāo)移動到下一行的開始
    d.退后一格
    3、假設(shè)您有一個程序count,該程序?qū)斎氲淖址M行統(tǒng)計。用count程序設(shè)計一個命令行命令,對文件essay中的字符進行計數(shù)并將結(jié)果保存在名為essayct的文件中。
    答:
    count < essay > essayct
    4、給定問題3中的程序和文件,下面哪個命令是正確的?
    答:
    a.essayct <essay
    b.count essay
    c.essay >count
    答:
    c是正確的。
    5、EOF是什么?
    答:
    它是由getchar()和scanf()返回的信號(一個特定的值),用來表明已經(jīng)到達了文件的結(jié)尾。
    6、對給出的輸入,下面每個程序段的輸出是什么(假定ch是int類型的,并且輸入是緩沖的)?
    a. 輸入如下所示:
        If you quit, I will.[enter]
        程序段如下所示:
        while ((ch = getchar()) != 'i')
                putchar(ch);
    b. 輸入如下所示:
        Harhar[enter]
        程序段如下所示:
        while ((ch = getchar()) != '\n')
        {
                   putchar(ch++);
                   putchar(++ch);
        }
    答:
    a.If you qu
    b.HJacrthjacrt
    7、C如何處理具有不同文件和換行約定的不同計算機系統(tǒng)?
    答:
    C的標(biāo)準(zhǔn)I/O庫把不同的文件形式映射為統(tǒng)一的流,這樣就可以按相同的方式對它們進行處理。
    8、在緩沖系統(tǒng)中把數(shù)值輸入與字符輸入相混合時,您所面臨的潛在問題是什么?
    答:
    數(shù)字輸入跳過空格和換行符,但是字符輸入并不是這樣。假設(shè)您編寫了這樣的代碼:
        int score;
        char grade;
        printf("Enter the score.\n");
        scanf("%d", &score);
        printf("Enter the letter grade.\n");
        grade = getchar();
    假設(shè)您輸入分?jǐn)?shù)98,然后按下回車鍵來把分?jǐn)?shù)發(fā)送給程序,您同時也發(fā)送了一個換行符,它會成為下一個輸入字符被讀取到grade中作為等級的值。如果在字符輸入之前進行了數(shù)字輸入,就應(yīng)該添加代碼以在獲取字符輸入之前剔除換行字符。
    編程練習(xí)
    1、
    #include <stdio.h>
    int main(void)
    {
        int ch;
        int count = 0;
        while((ch = getchar()) != EOF) // 包括換行符
            count++;
        printf("The number of characters is %d\n", count);
        return 0;
    }
    2、(覺得這題超難的!!!看了一些他人寫的例子,簡直胡說八道!!!不過還是完美解決了)
    #include <stdio.h>
    int main(void)
    {
        int ch;
        int i = 0;

        while((ch = getchar()) != EOF)
        {
            if(ch >= 32)  // 可打印字符
            {
                putchar(ch);
                printf("/%d  ", ch);
                i++;
            }
            else if(ch == '\n')  // 打印換行符
            {
                printf("\\n");
                printf("/%d  ", ch);
                putchar(ch); // 清除輸入緩沖區(qū)里面的換行符
                = 0// i置為0重新開始計數(shù),因為題目要求每次遇到一個換行符時就要開始打印一個新行
            }
            else if(ch == '\t')  // 打印制表符
            {
                printf("\\t");
                printf("/%d  ", ch);
                i++;
            }
            else // 打印控制字符
            {
                putchar('^');
                putchar(ch + 64);
                printf("/%d  ", ch);
            }
            if(i == 10)
            {
                putchar('\n');
                i = 0;
            }
        }
        return 0;
    }
    運行結(jié)果如下:
    I love you!
    I/73   /32  l/108  o/111  v/118  e/101   /32  y/121  o/111  u/117(每行打印10個值)
    !/33  \n/10(每次遇到一個換行符時就開始一個新行)
    My hello world^A
    M/77  y/121   /32  h/104  e/101  l/108  l/108  o/111   /32  w/119(每行打印10個值)
    o/111  r/114  l/108  d/100  ^A/1  \n/10(每次遇到一個換行符時就開始一個新行)
    ^Z
    3、
    #include <stdio.h>
    #include <ctype.h>
    int main(void)
    {
        int ch;
        int low_count = 0, up_count = 0;

        while((ch = getchar()) != EOF)
        {
            if(islower(ch))
                low_count++;
            if(isupper(ch))
                up_count++;
        }
        printf("A number of capital letters: %d\n", up_count);
        printf("A number of lower case letters: %d\n", low_count);
        return 0;
    }
    4、
    #include <stdio.h>
    #include <ctype.h>
    #include <stdbool.h>
    int main(void)
    {
        char ch;
        long chars = 0L; // 統(tǒng)計單詞的字符數(shù)
        int words= 0; // 單詞數(shù)
        bool inword = false// 如果ch在一個單詞中,則inword為true

        printf("Enter text to be analyzed: \n");
        while((ch = getchar()) != EOF)
        {
            if(!isspace(ch) && !ispunct(ch))
                chars++;
            if(!isspace(ch) && !inword)
            {
                inword = true;
                words++;
            }
            if(isspace(ch) && inword)
                inword = false;
        }
        printf("The average number of words per word: %ld\n", chars / words);
        return 0;
    }
    5、(二分搜索算法第一次碰見,搞了大半天了,借鑒的是CSDN-----vs9841作者的做法,不過稍微加了下工)
    #include <stdio.h>
    char get_choice(void);
    char get_first(void);
    int main(void)
    {
        int low = 1, high = 100, guess = 50;
        char ch;

        printf("Pick an integer from 1 to 100. I will try to guess it\n");
        printf("Unis your number %d?\n", guess);
        while((ch = get_choice()) != 'q')
        {
            if(ch == 'a')
            {
                printf("I knew I could do it!\n");
                break;
            }
            else if(ch == 'b')
            {
                printf("It is too small!\n");
                low = guess + 1;
            }
            else if(ch == 'c')
            {
                printf("It is too big!\n");
                high = guess - 1;
            }
            guess = (low + high) / 2;
            printf("Unis your number %d?\n", guess);
        }
        printf("Done!\n");
        return 0;
    }
    char get_choice(void)
    {
        int ch;

        printf("Enter the letter of your choice: \n");
        printf("a. right       b. too small\n");
        printf("c. too big     q. quit\n");
        ch = get_first();
        while((ch < 'a' || ch > 'c') && ch != 'q')
        {
            printf("Please respond with a, b, c, or q.\n");
            ch = get_first();
        }
        return ch;
    }
    char get_first(void)
    {
        int ch;

        ch = getchar();
        while(getchar() != '\n')
            continue;
        return ch;
    }
    6、
    char get_first(void)
    {
        int ch;

        while((ch = getchar()) == '\n')
            continue;
        while(getchar() != '\n')
            continue;
        return ch;
    }
    7、
    #include <stdio.h>
    #define WORK_OVERTIME 40
    #define MULTIPLE 1.5
    #define RATE1 0.15
    #define RATE2 0.20
    #define RATE3 0.25
    #define BREAK1 300
    #define BREAK2 450
    #define BASE1 (BREAK1 * RATE1)
    #define BASE2 (BASE1 + (BREAK2 - BREAK1) * RATE2)
    char get_choice(void);
    char get_first(void);
    int main(void)
    {
        int hour, choise;
        double total, tax, net_pay;
        double base_pay; // 基本工資等級不能用#define來定義了,因為它要隨著程序而改變了,書上真是胡說八道

        while((choise = get_choice()) != 'q')
        {
            switch(choise)
            {
            case 'a':
                base_pay = 8.15;
                break;  // break只是導(dǎo)致程序脫離switch語句,跳到switch之后的下一條語句!!!
            case 'b':
                base_pay = 9.33;
                break;
            case 'c':
                base_pay = 10.00;
                break;
            case 'd':
                base_pay = 11.20;
                break;
            default:
                printf("Program error!\n");
                break;
            }
            printf("Please enter the hour used: ");
            scanf("%d", &hour); // 獲取每周工作小時數(shù)時沒有像書上那樣判斷,我偷懶了!!!
            if(hour <= WORK_OVERTIME)
            {
                total = hour * base_pay;
                if (total <= BREAK1)
                {
                    tax = total * RATE1;
                    net_pay = total - tax;
                }
                else
                {
                    tax = BASE1 + (total - BREAK1) * RATE2;
                    net_pay = total - tax;
                }
            }
            else
            {
                total = base_pay * WORK_OVERTIME + (hour - WORK_OVERTIME) * MULTIPLE * base_pay;
                if(total <= BREAK2)
                {
                    tax = BASE1 + (total - BREAK1) * RATE2;
                    net_pay = total - tax;
                }
                else
                {
                    tax = BASE2 + (total - BREAK2) * RATE3;
                    net_pay = total - tax;
                }
            }
            printf("The total pay: %.2f; tax: %.2f; net pay: %.2f\n", total, tax, net_pay);
        }
        printf("Bye!\n");
        return 0;
    }
    char get_choice(void)
    {
        int ch;

        printf("*****************************************************************\n");
        printf("Enter number corresponding to the desired pay rate or action:\n");
        printf("a) $8.75/hr\tb) $9.33/hr\n");
        printf("c) $10.00/hr\td) $11.20/hr\n");
        printf("q) quit\n");
        printf("*****************************************************************\n");
        printf("Please enter your choise: ");
        ch = get_first();
        while((ch < 'a' || ch > 'd') && ch != 'q')
        {
            printf("Please respond with a, b, c, d, or q.\n");
            ch = get_first();
        }
        return ch;
    }
    char get_first(void)
    {
        int ch;

        while((ch = getchar()) == '\n')
            continue;
        while(getchar() != '\n')
            continue;
        return ch;
    }
    8、
    #include <stdio.h>
    char get_choice(void);
    char get_first(void);
    float get_float(void);
    int main(void)
    {
        char choise;
        float first_number, second_number;

        while((choise = get_choice()) != 'q')
        {
            printf("Enter first number: ");
            first_number = get_float();
            printf("Enter second number: ");
            second_number = get_float();
            switch(choise)
            {
            case 'a':
                printf("%.1f + %.1f = %.1f\n", first_number, second_number, first_number + second_number);
                break;
            case 's':
                printf("%.1f - %.1f = %.1f\n", first_number, second_number, first_number - second_number);
                break;
            case 'm':
                printf("%.1f * %.1f = %.1f\n", first_number, second_number, first_number * second_number);
                break;
            case 'd':
                if(second_number == 0)
                {
                    printf("Enter a number other than 0: ");
                    second_number = get_float();
                    printf("%.1f / %.1f = %.1f\n", first_number, second_number, first_number / second_number);
                }
                else
                    printf("%.1f / %.1f = %.1f\n", first_number, second_number, first_number / second_number);
                break;
            default:
                printf("Program error!\n");
                break;
            }
        }
        printf("Bye.\n");
        return 0;
    }
    char get_choice(void)
    {
        int ch;

        printf("Enter the operation of your choice: \n");
        printf("a. add\ts. subtract\n");
        printf("m. multiply\td. divide\n");
        printf("q. quit\n");
        ch = get_first();
        while(ch != 'a' && ch != 's' && ch != 'm' && ch != 'd' && ch != 'q')
        {
            printf("Please respond with a, s, m, d, or q.\n");
            ch = get_first();
        }
        return ch;
    }
    char get_first(void)
    {
        int ch;

        while((ch = getchar()) == '\n')
            continue;
        while(getchar() != '\n')
            continue;
        return ch;
    }
    float get_float(void)
    {
        float input;
        char ch;

        while((scanf("%f", &input)) != 1)
        {
            while((ch = getchar()) != '\n')
                putchar(ch);
            printf(" is not a number.\nPlease enter a ");
            printf("number, such as 2.5, -1.78E8, or 3: ");
        }
        return input;
    }

    posted @ 2015-11-21 20:12 李阿昀 閱讀(429) | 評論 (0)編輯 收藏

         摘要: 復(fù)習(xí)題1、確定哪個表達式為true,哪個為false。Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->    a.100 > 3 && 'a' >&nbs...  閱讀全文
    posted @ 2015-11-20 00:02 李阿昀 閱讀(587) | 評論 (0)編輯 收藏

         摘要: 復(fù)習(xí)題1、給出每行之后quack的值Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->    int quack = 2;    quack +...  閱讀全文
    posted @ 2015-11-19 14:04 李阿昀 閱讀(614) | 評論 (0)編輯 收藏

    復(fù)習(xí)題
    1、假定所有的變量都是int類型。找出下面每一個變量的值:
    a.x = (2 + 3) * 6;
    b.x = (12 + 6) / 2 * 3;
    c.y = x = (2 + 3) / 4;
    d.y = 3 + 2 * (x = 7 / 2);
    答:
    a.
    x = 30
    b.
    x = 27
    c.
    x = 1
    y = 1
    d.
    x = 3
    y = 9
    2、假定所有的變量都是int類型。找出下面每一個變量的值:
    a.x = (int) 3.8 + 3.3;
    b.x = (2 + 3) * 10.5;
    c.x = 3 / 5 * 22.0;
    d.x = 22.0 * 3 /5;
    答:
    a.
    x = 6
    b.
    x = 52
    c.
    x = 0
    d.
    x = 13
    3、您懷疑下面的程序里有一些錯誤。您能找出這些錯誤嗎?
     1 int main(void)
     2 {
     3     int i = 1,
     4     float n;
     5     printf("Watch out! Here come a bunch of fractions!\n");
     6     while(i < 30)
     7         n = 1/i;
     8         printf("%f", n);
     9     printf("That's all, folks!\n");
    10     return;
    11 }
    答:
    第0行:應(yīng)該有#include <stdio.h>。
    第3行:應(yīng)該以分號而不是逗號結(jié)尾。
    第6行:while語句建立一個無限循環(huán)。因為i的值保持為1,所以它總是小于30。推測一下它的意思大概是要寫成while(i++ < 30)。
    第6到8行:這樣的縮排說明我們想要使第7行和8行組成一個代碼塊,但是缺少了花括號會使while循環(huán)只包括第7行。應(yīng)該添加花括號。
    第7行:因為1和i都是整數(shù),所以當(dāng)i為1時除法運算的結(jié)果會是1,而當(dāng)i為更大的數(shù)時結(jié)果為0。使用n = 1.0/i;會使i在進行除法運算之前先轉(zhuǎn)換為浮點數(shù),這樣就會產(chǎn)生非0的答案。
    第8行:我們在控制語句中漏掉了換行符(\n),這會使數(shù)字只要可能就在一行中打印。
    第10行:應(yīng)該是return 0;。
    下面是一個正確的版本:
     1 #include <stdio.h>
     2 int main(void)
     3 {
     4     int i = 1;
     5     float n;
     6     printf("Watch out! Here come a bunch of fractions!\n");
     7     while(i++ < 30)
     8     {
     9         n = 1.0/i;
    10         printf("%f\n", n);
    11     }
    12     printf("That's all, folks!\n");
    13     return 0;
    14 }
    4、這是程序清單5.9的其他一種設(shè)計方法。表面上看,它使用了一個scanf()函數(shù)替代了程序清單5.9中的兩個scanf()。但是該程序不令人滿意。和程序清單5.9相比,它有什么缺點?
     1 #include <stdio.h>
     2 #define S_TO_M 60
     3 int main(void)
     4 {
     5     int sec, min, left;
     6     printf("This program converts seconds to minutes and ");
     7     printf("seconds.\n");
     8     printf("Just enter the number of seconds.\n");
     9     printf("Enter 0 to end the program.\n");
    10     while(sec > 0)
    11     {
    12         scanf("%d", &sec);
    13         min = sec / S_TO_M;
    14         left = sec % S_TO_M;
    15         printf("%d sec is %d min, %d sec.\n", sec, min, left);
    16         printf("Next input?\n");
    17     }
    18     printf("Bye!\n");
    19     return 0;
    20 }
    答:(參考課后答案)
    主要問題在于判斷語句(sec是否大于0?)和獲取sec值的scanf()語句之間的關(guān)系。具體地說,第一次進行判斷時,程序還沒有機會來獲得sec的值,這樣就會對碰巧處在那個內(nèi)存位置的一個垃圾值進行比較。一個比較笨拙的解決方法是對sec進行初始化,比如把它初始化為1,這樣就可以通過第一次判斷。但是還有一個問題,當(dāng)最后輸入0來停止程序時,在循環(huán)結(jié)束之前不會檢查sec,因而0秒的結(jié)果也被打印出來。更好的方法是使scanf()語句在進行while判斷之前執(zhí)行。可以通過像下面這樣改變程序的讀取部分來做到這一點:
    1 scanf("%d", &sec);
    2 while(sec > 0)
    3 {
    4      min = sec / S_TO_M;
    5      left = sec % S_TO_M;
    6      printf("%d sec is %d min, %d sec.\n", sec, min, left);
    7      printf("Next input?\n");
    8      scanf("%d", &sec);
    9 }
    第一次獲取輸入使用循環(huán)外部的scanf(),以后就使用在循環(huán)結(jié)尾處(也即在循環(huán)再次執(zhí)行之前)的scanf()語句。這是處理這類問題的一個常用方法。
    5、下面的程序?qū)⒋蛴∈裁矗?br />
     1 #include <stdio.h>
     2 #define FORMAT "%s! C is cool!\n"
     3 int main(void)
     4 {
     5     int num = 10;
     6 
     7     printf(FORMAT, FORMAT);
     8     printf("%d\n", ++num);
     9     printf("%d\n", num++);
    10     printf("%d\n", num--);
    11     printf("%d\n", num);
    12     return 0;
    13 }
    答:
    %s! C is cool!
    ! C is cool!
    11
    11
    12
    11
    6、下面的程序?qū)⒋蛴∈裁矗?br />
     1 #include <stdio.h>
     2 int main(void)
     3 {
     4     char c1, c2;
     5     int diff;
     6     float num;
     7 
     8     c1 = 'S';
     9     c2 = 'O';
    10     diff = c1 - c2;
    11     num = diff;
    12     printf("%c%c%c: %d %3.2f\n", c1, c2,c1, diff, num);
    13     return 0;
    14 }
    答:
    SOS: 4 4.00
    7、下面的程序?qū)⒋蛴〕鍪裁矗?br />
     1 #include <stdio.h>
     2 #define TEN 10
     3 int main(void)
     4 {
     5     int n = 0;
     6     while(n++ < TEN)
     7         printf("%5d", n);
     8     printf("\n");
     9     return 0;
    10 }
    答:
       1   2   3   4   5   6   7   8   9   10(注意:每個數(shù)字占據(jù)5列的寬度)  
    8、修改上一個程序,讓它打印從a到g的字母。
    答:
     1 #include <stdio.h>
     2 #define CHARACTER 'g'
     3 int main(void)
     4 {
     5     char ch = 'a' - 1;
     6     while(ch++ < CHARACTER)
     7         printf("%3c", ch);
     8     printf("\n");
     9     return 0;
    10 }
    9、如果下面的片段是一個完整程序的一部分,它們將打印出什么?
    a.
    1 int x = 0;
    2 while(++x < 3)
    3    printf("%4d", x);
    b.(注意:使第二個printf()語句縮進并不能使它成為while循環(huán)的一部分。因此它只是在while循環(huán)結(jié)束之后被調(diào)用一次,我看成一個代碼塊了)
    1 int x = 100;
    2 
    3 while(x++ < 103)
    4    printf("%4d\n", x);
    5    printf("%4d\n", x);
    c.
    1 char ch = 's';
    2 
    3 while(ch < 'w')
    4 {
    5     printf("%c", ch);
    6     ch++;
    7 }
    8 printf("%c\n", ch);
    答:
    a.
       1   2
    b.
     101
     102
     103
     104
    c.
    stuvw
    10、下面的程序?qū)⒋蛴∈裁矗?br />
     1 #define MESG "COMPUTER BYTES DOG"
     2 #include <stdio.h>
     3 int main(void)
     4 {
     5     int n = 0;
     6 
     7     while(n < 5)
     8         printf("%s\n", MESG);
     9         n++;
    10     printf("That's all.\n");
    11     return 0;
    12 }
    答:
    這是一個構(gòu)造有缺陷的程序。因為while語句沒有使用花括號,只有printf()語句作為循環(huán)的一部分,所以程序無休止地打印消息COMPUTER BYTES DOG直到您強行關(guān)閉程序為止。
    11、構(gòu)造完成下面功能(或者用一個術(shù)語來說,有下面的副作用)的語句:
    a.把變量x的值增加10
    b.把變量x的值增加1
    c.將a與b之和的兩倍賦給c
    d.將a與兩倍的b之和賦給c
    答:
    a.x = x + 10;
    b.x++; or ++x; or x = x + 1;
    c.c = (a + b) * 2;
    d.c = a + 2 * b;
    12、構(gòu)造具有下面功能的語句:
    a.把變量x的值減1
    b.把n除以k所得的余數(shù)賦給m
    c.用b減去a的差去除q,并將結(jié)果賦給p
    d.用a與b的和除以c與d的乘積,并將結(jié)果賦給x
    答:
    a.x--; or --x; or x = x - 1;
    b.m = n % k;
    c.p = q / (b - a);
    d.x = (a + b) / (c * d);
    編程練習(xí)
    1、
     1 #include <stdio.h>
     2 const int PARAM = 60;
     3 int main(void)
     4 {
     5     int min, hour, left;
     6 
     7     printf("Convert minutes to hours and minutes!\n");
     8     printf("Enter the number of minutes (<=0 to quit):\n");
     9     scanf("%d", &min);
    10     while(min > 0)
    11     {
    12         hour = min / PARAM;
    13         left = min % PARAM;
    14         printf("%d minutes is %d hours, %d minutes.\n", min, hour, left);
    15         printf("Enter next value (<=0 to quit): \n");
    16         scanf("%d", &min);
    17     }
    18     printf("Done!\n");
    19     return 0;
    20 }
    2、
     1 #include <stdio.h>
     2 int main(void)
     3 {
     4     int number, maxnum;
     5     printf("Please enter a int number:\n");
     6     scanf("%d", &number);
     7     maxnum = number + 10;
     8     while(number <= maxnum)
     9     {
    10         printf("%5d", number++);
    11     }
    12     printf("\n");
    13     return 0;
    14 }
    3、(與題目1類似)
     1  #include <stdio.h>
     2  const int PARAM = 7;
     3  int main(void)
     4  {
     5      int day, week, left;
     6 
     7      printf("Convert days to weeks and days!\n");
     8      printf("Enter the number of days (<=0 to quit):\n");
     9      scanf("%d", &day);
    10      while(day > 0)
    11      {
    12          week = day / PARAM;
    13          left = day % PARAM;
    14          printf("%d days are %d weeks, %d days.\n", day, week, left);
    15          printf("Enter next value (<=0 to quit): \n");
    16          scanf("%d", &day);
    17      }
    18      printf("Done!\n");
    19      return 0;
    20 }
    4、
     1  #include <stdio.h>
     2  #define CM_PER_INCH 0.3937
     3  #define FEET_PER_INCH 12
     4  int main(void)
     5  {
     6      float cm, inch, left;
     7      int feet;
     8 
     9      printf("Enter a height in centimeters: ");
    10      scanf("%f", &cm);
    11      while(cm > 0)
    12      {
    13          inch = cm * CM_PER_INCH;
    14          feet = inch / FEET_PER_INCH;
    15          left = (inch / FEET_PER_INCH - feet) * FEET_PER_INCH ;
    16          printf("%.1f cm = %d feet, %.1f inches.\n", cm, feet, left);
    17          printf("Enter a height in centimeters (<=0 to quit): ");
    18          scanf("%f", &cm);
    19      }
    20      printf("bye\n");
    21      return 0;
    22 }
    5、
     1 #include <stdio.h>
     2 int main(void)
     3 {
     4     int count, sum, limit;
     5     count = 0;
     6     sum = 0;
     7 
     8     printf("Please enter a limit number: ");
     9     scanf("%d", &limit);
    10     while(count++ < limit)
    11     {
    12         sum = sum + count;
    13     }
    14     printf("sum = %d\n", sum);
    15     return 0;
    16 }
    6、
     1 #include <stdio.h>
     2 int main(void)
     3 {
     4     int count, sum, limit;
     5     count = 0;
     6     sum = 0;
     7 
     8     printf("Please enter a limit number: ");
     9     scanf("%d", &limit);
    10     while(count++ < limit)
    11     {
    12         sum = sum + count * count;
    13     }
    14     printf("sum = %d\n", sum);
    15     return 0;
    16 }
    7、
     1 #include <stdio.h>
     2 float cube(float num);
     3 int main(void)
     4 {
     5     float number;
     6     printf("Please enter a number: ");
     7     scanf("%f", &number);
     8     printf("The cube of the %.2f is %.2f", number, cube(number));
     9     return 0;
    10 }
    11 float cube(float num)
    12 {
    13     return num * num * num;
    14 }
    8、(注意:我用到了<string.h>頭文件中的getchar()函數(shù),還是用目前的知識弄不出來,啊!
     1 #include <stdio.h>
     2 #include <string.h>
     3 const float ONE_PARAM = 1.8;
     4 const float TWO_PARAM = 32.0;
     5 const float THREE_PARAM = 273.16;
     6 void temperatures(double fahrenheit);
     7 int main(void)
     8 {
     9     float number;
    10     while(1==1)
    11     {
    12         printf("Please again enter a fahrenheit's temperature: ");
    13         scanf("%f", &number);
    14         if(getchar() == 'q')
    15         {
    16             break;
    17         }
    18         temperatures(number);
    19     }
    20     printf("Done!\n");
    21     return 0;
    22 }
    23 void temperatures(double fahrenheit)
    24 {
    25     float celsius, kelvin;
    26     celsius = ONE_PARAM * fahrenheit + 32.0;
    27     kelvin = celsius + 273.16;
    28     printf("fahrenheit is %.2f, celsius is %.2f, kelvin is %.2f.\n", fahrenheit, celsius, kelvin);
    29 }
    今天看到第6章 循環(huán)部分,原來可以這樣做,是我讀書太不用心了!
     1  #include <stdio.h>
     2  #include <string.h>
     3  const float ONE_PARAM = 1.8;
     4  const float TWO_PARAM = 32.0;
     5  const float THREE_PARAM = 273.16;
     6  void temperatures(double fahrenheit);
     7  int main(void)
     8  {
     9     float number;
    10 
    11     printf("Please again enter a fahrenheit's temperature: ");
    12     while(scanf("%f", &number) == 1)
    13     {
    14         temperatures(number);
    15         printf("Please again enter a fahrenheit's temperature: ");
    16     }
    17     printf("Done!\n");
    18     return 0;
    19 }
    20 void temperatures(double fahrenheit)
    21 {
    22     float celsius, kelvin;
    23     celsius = ONE_PARAM * fahrenheit + 32.0;
    24     kelvin = celsius + 273.16;
    25     printf("fahrenheit is %.2f, celsius is %.2f, kelvin is %.2f.\n", fahrenheit, celsius, kelvin);
    26 }
    posted @ 2015-11-14 16:33 李阿昀 閱讀(481) | 評論 (0)編輯 收藏

    復(fù)習(xí)題
    1、再次運行程序清單4.1,但是在要求您輸入名字時,請輸入您的名字和姓氏。發(fā)生了什么?為什么?
    答:
     1 #include <stdio.h>
     2 #include <string.h>
     3 #define DENSITY 62.4
     4 int main(void)
     5 {
     6     float weight, volume;
     7     int size, letters;
     8     char name[40]; // name是一個有40個字符的數(shù)組
     9 
    10     printf("Hi! What's your first name?\n");
    11     scanf("%s", name);
    12     printf("%s, what's your weight in pounds?\n", name);
    13     scanf("%f", &weight);
    14     size = sizeof(name);
    15     letters = strlen(name);
    16     volume = weight / DENSITY;
    17     printf("Well, %s, your volume is %2.2f cubic feet.\n", name, volume);
    18     printf("Also, your first name has %d letters, \n", letters);
    19     printf("and we have %d bytes to store it in.\n", size);
    20     return 0;
    21 }
    如果輸入名字和姓氏,會輸出如下結(jié)果:
    Hi! What's your first name?
    Li Ayun
    Li, what's your weight in pounds?
    Well, Li, your volume is 0.00 cubic feet.
    Also, your first name has 2 letters,
    and we have 40 bytes to store it in.
    原因:(參考課后答案)程序不能正常工作。第一個scanf()語句只是讀入您的名而沒有讀入您的姓,您的姓依然存儲在輸入“緩沖區(qū)”(緩沖區(qū)只是一塊用來存放輸入的臨時存儲區(qū)域)中。當(dāng)下一個scanf()語句想要讀入您的體重時,它從上次讀入結(jié)束的地方開始,這樣就試圖把您的姓作為體重來讀取。這會使scanf()失敗。一方面,如果您對姓名請求做出像Li 123這樣的響應(yīng),程序會使用123作為您的體重,雖然您是在程序請求體重之前輸入123的。
    2、假定下列每個示例都是某個完整程序的一部分。它們的打印結(jié)果分別是什么?
    a.printf("He sold the painting for $%2.2f.\n", 2.345e2);
    b.printf("%c%c%c\n", 'H', 105, '\41');
    c.#define Q "His Hamlet was funny without being vulgar. "
             printf("%s\nhas %d characters.\n", Q, strlen(Q));
    d.printf("Is %2.2e the same as %2.2f?\n", 1201.0, 1201.0);
    答:
    a.He sold the painting for $234.50.
    b.Hi!
    c.His Hamlet was funny without being vulgar. (注意,與課后答案不一樣,是因為細(xì)看題目的話,此句末尾有一個空格,strlen()函數(shù)輸出字符串中字符(包括空格和標(biāo)點符號)的準(zhǔn)確數(shù)目)
       has 43 characters.
    d.Is 1.20e+003 the same as 1201.00?
    3、在問題2c中,應(yīng)進行哪些修改以使字符串Q引在雙引號中輸出?
    答:
    使用\"。示例如下:
    printf("\"%s\"\nhas %d characters.\n", Q, strlen(Q));
    4、找出下列程序中的錯誤。
     1 define B booboo
     2 define X 10
     3 main(int)
     4 {
     5     int age;
     6     char name;
     7 
     8     printf("Please enter your first name. ");
     9     scanf("%s", name);
    10     printf("All right, %c, what's your age?\n", name);
    11     scanf("%f", age);
    12     xp = age + X;
    13     printf("That's a %s! You must be at least %d.\n", B, xp);
    14     rerun 0;
    15 }
    答:
    下面是一個正確的版本:
     1 #include <stdio.h>
     2 #include <string.h>
     3 #define B "booboo"
     4 #define X 10
     5 int main(void)
     6 {
     7     int age;
     8     int xp;
     9 
    10     char name[40];
    11 
    12     printf("Please enter your first name. \n");
    13     scanf("%s", name);
    14     printf("All right, %s, what's your age?\n", name);
    15     scanf("%d", &age);
    16     xp = age + X;
    17     printf("That's a %s! You must be at least %d.\n", B, xp);
    18     return 0;
    19 }
    5、假設(shè)一個程序這樣開始:
    1 #define BOOK "War and Peace"
    2 int main(void)
    3 {
    4     float cost = 12.99;
    5     float precent = 80.0;
    請構(gòu)造一個printf()語句,使用BOOK、cost和percent打印下列內(nèi)容:
    This copy of "War and Peace" sells for $12.99.
    That is 80% of list.
    答:
    printf("This copy of \"%s\" sells for $%.2f.\nThat is %.0f%% of list.", BOOK, cost, percent);
    6、您會使用什么轉(zhuǎn)換說明來打印下列各項內(nèi)容?
    a.一個字段寬度等于數(shù)字位數(shù)的十進制整數(shù)。
    b.一個形如8A、字段寬度為4的十六進制整數(shù)。
    c.一個形如232.346、字段寬度為10的浮點數(shù)。
    d.一個形如2.33e+002、字段寬度為12的浮點數(shù)。
    e.一個字段寬度為30、左對齊的字符串。
    答:
    a.%d
    b.%4X
    c.%10.3f
    d.%12.2e
    e.%-30s
    對于浮點數(shù)來說,字段寬度包含了小數(shù)點右邊的數(shù)字的數(shù)目
    7、您會使用哪個轉(zhuǎn)換說明來打印下列各項內(nèi)容?
    a.一個字段寬度為15的unsigned long整數(shù)
    b.一個形如0x8a、字段寬度為4的十六進制整數(shù)
    c.一個形如2.33E+02、字段寬度為12、左對齊的浮點數(shù)
    d.一個形如+232.346、字段寬度為10的浮點數(shù)
    e.一個字符串的前8個字符,字段寬度為8字符
    答:
    a.%15lu
    b.%#4x(字段寬度應(yīng)放在#和x之間)
    c.%-12.2E("-"修飾符使浮點數(shù)左對齊輸出)
    d.%+10.3f
    e.%-8.8s("-"修飾符使文本左對齊輸出)
    8、您會使用什么轉(zhuǎn)換說明來打印下列各項內(nèi)容?
    a.一個字段寬度為6、最少有4位數(shù)字的十進制整數(shù)
    b.一個字段寬度在參數(shù)列表中給定的八進制整數(shù)
    c.一個字段寬度為2的字符
    d.一個形如+3.13、字段寬度等于數(shù)字中字符個數(shù)的浮點數(shù)
    e.一個字符串的前5個字符,字段寬度為7、左對齊
    答:
    a.%6.4d
    b.%*o(此處為小寫字母o,而不是數(shù)字0)
    c.%2c
    d.%+.2f
    e.%-7.5s
    9、為下列每個輸入行提供一個對其進行讀取的scanf()語句,并聲明語句中用到的所有變量或數(shù)組。
    a.101
    b.22.32 8.34E-09
    c.linguini
    d.catch 22
    e.catch 22(但是跳過catch)
    答:
    a.
    1 int num;
    2 scanf("%d", &num);
    b.
    1 float kgs, share;
    2 scanf("%f%f", &kgs, &share);
    c.
    1 char str[40];
    2 scanf("%s", str);
    d.
    1 char str[40];
    2 int number;
    3 scanf("%s %d", str,&number);
    e.
    1 char str[40];
    2 int number;
    3 scanf("%s %d", str, &number);
    10、什么是空白字符?
    答:
    空白字符包括空格、制表符和換行符。C使用空白字符分隔各個語言符號;scanf()使用空白字符分隔相鄰的輸入項。
    11、假設(shè)您想在程序中使用圓括號代替花括號。以下方法可以嗎?
    #define ( {
    #define ) }
    答:
    會發(fā)生替換。但不幸的是,預(yù)處理器不能區(qū)別哪些圓括號應(yīng)該被替換成花括號,哪些圓括號不應(yīng)該被替換成花括號。因此:
    1 #include <stdio.h>
    2 #define ( {
    3 #define ) }
    4 int main(void)
    5 (
    6     printf("Hello World!\n");
    7     return 0;
    8 )
    會變?yōu)椋?br />
    1 #include <stdio.h>
    2 int main{void}
    3 {
    4     printf{"Hello World!\n"};
    5     return 0;
    6 }
    所有圓括號都要替換為花括號。
    編程練習(xí)
    1、
     1 #include <stdio.h>
     2 int main(void)
     3 {
     4     char name[40]; // 名字
     5     char surname[40]; // 姓氏
     6 
     7     printf("Please enter your name and surname: \n");
     8     scanf("%s%s", name, surname);
     9     printf("%s,%s", surname, name);
    10     return 0;
    11 }
    2、
     1 #include <stdio.h>
     2 #include <string.h>
     3 int main(void)
     4 {
     5     char name[40]; // 名字
     6 
     7     printf("Please enter your name: \n");
     8     scanf("%s", name);
     9     printf("\"%s\"\n", name);
    10     printf("\"%20s\"\n", name);
    11     printf("\"%-20s\"\n", name);
    12     printf("%*s\n", strlen(name)+3, name);
    13     return 0;
    14 }
    3、
     1 #include <stdio.h>
     2 int main(void)
     3 {
     4     float number;
     5 
     6     printf("Please enter a float number: \n");
     7     scanf("%f", &number);
     8     printf("The input is %.1f or %.1e\n", number, number);
     9     printf("The input is %+.3f or %.3E\n", number, number);
    10     return 0;
    11 }
    4、
     1 #include <stdio.h>
     2 int main(void)
     3 {
     4     /* 以厘米為單位輸入身高,并以米為單位進行顯示 */
     5     float weight;
     6     char name[40];
     7 
     8     printf("Please enter your weight(cm): \n");
     9     scanf("%f", &weight);
    10     printf("Please enter your name: \n");
    11     scanf("%s", name);
    12     printf("%s, you are %.2f meter tall\n", name, weight/100);
    13     return 0;
    14 }
    5、
     1 #include <stdio.h>
     2 #include <string.h>
     3 int main(void)
     4 {
     5     char name[40]; // 名字
     6     char surname[40]; // 姓氏
     7 
     8     printf("Please enter your name: \n");
     9     scanf("%s", name);
    10     printf("Please enter your surname: \n");
    11     scanf("%s", surname);
    12     printf("%10s %10s\n", surname, name);
    13     printf("%10d %10d\n", strlen(surname), strlen(name));
    14     printf("%-10s %-10s\n", surname, name);
    15     printf("%-10d %-10d\n", strlen(surname), strlen(name));
    16     return 0;
    17 }
    結(jié)果為:(看起來有一點怪啊!!!)
    Please enter your name:
    Ayun
    Please enter your surname:
    li
            li       Ayun
             2           4
    li         Ayun
    2         4
    6、
     1 #include <stdio.h>
     2 #include <float.h>
     3 int main(void)
     4 {
     5     double dblnum = 1.0/3.0;
     6     float fltnum = 1.0/3.0;
     7 
     8     printf("%.4f\n", dblnum);
     9     printf("%.12f\n", dblnum);
    10     printf("%.16f\n", dblnum);
    11     printf("%.4f\n", fltnum);
    12     printf("%.12f\n", fltnum);
    13     printf("%.16f\n", fltnum);
    14     printf("double precision = %d digits\n", DBL_DIG);
    15     printf("float precision = %d digits\n", FLT_DIG);
    16     return 0;
    17 }
    7、(定義浮點類型的時候是使用float,還是double好???)
     1 #include <stdio.h>
     2 #define LITRE 3.785
     3 #define KM 1.609
     4 int main(void)
     5 {
     6     float mile; // 英里數(shù)
     7     float gallon; // 加侖數(shù)
     8 
     9     printf("Please enter your mile: \n");
    10     scanf("%f", &mile);
    11     printf("Please enter your gallon: \n");
    12     scanf("%f", &gallon);
    13     printf("Miles per gallon of gasoline: %.1f\n", mile/gallon);
    14     printf("Liters per 100 kilometers: %.1f\n", gallon*LITRE*100/(mile*KM));
    15     return 0;
    16 }
    posted @ 2015-11-14 02:01 李阿昀 閱讀(818) | 評論 (0)編輯 收藏

    第3章  數(shù)據(jù)和C
    復(fù)習(xí)題
    1、對下面的各種數(shù)據(jù)使用合適的數(shù)據(jù)類型:
         a.East Simpleton的人口
         b.DVD影碟的價格
         c.本章出現(xiàn)次數(shù)最多的字母
         d.這個字母出現(xiàn)的次數(shù)
    答:a.int類型,可以是short、unsigned或unsigned short;人口數(shù)是一個整數(shù)。
          b.float類型;價格不太可能正好是一個整數(shù)(您也可以使用double,但實際上并不需要那么高的精度)。
          c.char類型。
          d.int類型,可以是unsigned。
    2、需要用long類型變量代替int類型變量的原因是什么?
    答:一個原因是在您的系統(tǒng)中l(wèi)ong可以容納比int類型更大的數(shù);一個原因是如果您確實需要處理更大的值,那么使用一種在所有系統(tǒng)上都能保證至少是32位的類型會使程序的可移植性更好。
    3、獲得一個32位的有符號整數(shù),可以使用哪些可移植的數(shù)據(jù)類型?每種選擇的原因是什么?
    答:要獲得正好是32位的數(shù),您可以使用int32_t(如果在您的系統(tǒng)上有這一定義的話)。要獲得可存儲至少32位的最小類型,可以使用int_least32_t。如果要在32位的類型中獲得提供最快計算速度的類型,可以選擇int_fast32_t。(參考
    3.4.5  可移植的類型:inttypes.h,理解的不是很清楚!!!)
    4、指出下列常量的類型和意義(如果有的話):
         a.'\b'
         b.1066
         c.99.44
         d.0XAA
         e.2.0e30
    答:a.char常量(但以int類型存儲)
          b.int常量
          c.double常量
          d.unsigned int常量,十六進制格式
          e.double常量
    5、Dottie Cawm寫的下面這個程序中有很多錯誤,找出這些錯誤。
    1 include <stdio.h>
    2 main
    3 (
    4     float g; h;
    5     float tax, rate;
    6 
    7     g = e21;
    8     tax = rate * g;
    9 )
    答:第1行:應(yīng)該是#include <stdio.h>
          第2行:應(yīng)該是int main(void)
          第3行:使用{,而不是(
          第4行:在g和h之間應(yīng)該是逗號而不是分號
          第5行:無錯誤
          第6行:(空行)無錯誤
          第7行:在e之前應(yīng)該至少有一個數(shù)字,.1e21或1.e21都是正確的,盡管這個數(shù)有點大。
          第8行:無錯誤,至少在語法上沒有
          第9行:使用},而不是)
    缺少的行:首先,rate沒有被賦值。其次,變量h從來沒有被使用。而且程序永遠(yuǎn)不會把它的計算結(jié)果通知給您。這些錯誤都不會阻止程序的運行(盡管可能會向您出示一個警告以說明變量沒有被使用),但是它們確實減弱了程序本來就不多的功能。而且在結(jié)尾處應(yīng)該有一個return語句。
       下面是正確版本之一:  
     
     1 #include <stdio.h>
     2
     int main(void)
     3 {
     4     float g, h;
     5     float tax, rate;
     6     rate = 0.08;
     7     g = 1.0e5;
     8 
     9     tax = rate * g;
    10     h = g + tax;
    11     printf("You owe $%f plus $%f in taxes for a total of $%f.\n", g, tax, h);
    12     return 0;
    13 }
    6、指出下表中各常量的數(shù)據(jù)類型(在聲明語句中使用的數(shù)據(jù)類型)及其在printf()中的格式說明符。
              常量         類型        說明符     

    12

    0x3
      'C'  
      2.34E07  
     '\040'   
     7.0   
     6L   
     6.0f   













    答:
              常量           類型           說明符     

    12int%d

    0x3unsigned int%#x
      'C'char %c 
      2.34E07double  %f
     '\040' char  %c
     7.0 double  %f
     6L long  %ld
     6.0f float %e 












    7、
    指出下表中各常量的數(shù)據(jù)類型(在聲明語句中使用的數(shù)據(jù)類型)及其在printf()中的格式說明符,假設(shè)int類型為16位長。
              常量         類型        說明符     

    012

    2.9e05L
      's'  
      100000  
     '\n'   
     20.0f   
     0x44   
















    答:
              常量           類型           說明符     

    012int%#0

    2.9e05Llong double%Le
      's'char %c 
      100000long %ld 
     '\n' char%c 
     20.0f float %f 
     0x44 unsigned int %#x 
















    8、假設(shè)一個程序開始處有如下的聲明:
    1 int imate = 2;
    2 long shot = 53456;
    3 char grade = 'A';
    4 float log = 2.71828;
    在下面printf()語句中添上合適的類型說明符:
    1 printf("The odds against the %___ were %___ to 1.\n", imate, shot);
    2 printf("A score of %___ is not an %___ grade.\n", log, grade);
    答:
    1 printf("The odds against the %d were %ld to 1.\n", imate, shot);
    2 printf("A score of %f is not an %c grade.\n", log, grade);
    9、假設(shè)ch為char類型變量。使用轉(zhuǎn)義序列、十進制值、八進制字符常量以及十六進制字符常量等方法將其賦值為回車符(假設(shè)使用ASCII編碼)。
    答:
    1 char ch = '\r';
    2 char ch = 13;
    3 char ch = '\015';
    4 char ch = '\xd';
    10、改正下面程序(在C中/表示除法)。
    1 void main(int) / this progarm is perfect /
    2 {
    3    cows, legs integer;
    4    printf("How many cow legs did you count?\n);
    5    scanf("%c", legs);
    6    cows = legs / 4;
    7    printf("That implies there are %f cows.\n", cows)
    8 }
    答:
     1 #include <stdio.h>
     2 int main(void/* this progarm is perfect */
     3 {
     4    int cows, legs;
     5    printf("How many cow legs did you count?\n");
     6    scanf("%d", &legs);
     7    cows = legs / 4;
     8    printf("That implies there are %d cows.\n", cows);
     9    return 0;
    10 }
    11、指出下列轉(zhuǎn)義字符的含義:
    1 a.\n
    2 b.\\
    3 c.\"
    4 d.\t
    答:a.換行字符
          b.反斜線字符
          c.雙引號字符
          d.制表字符
    編程練習(xí)(如有錯誤,希望指正!!!)
    1、
     1 /* 整數(shù)上溢*/
     2 #include <stdio.h>
     3 int main(void)
     4 {
     5     int i = 2147483647;
     6     unsigned int j = 4294967295;
     7 
     8     /*
     9         無符號整數(shù)j像一個汽車?yán)锍讨甘颈恚ㄐ稳莸奶昧耍蓞⒖肌队嬎銠C科學(xué)導(dǎo)論》第3章 數(shù)據(jù)存儲,有圖),
    10        當(dāng)達到最大值時,它將溢出到起始點。整數(shù)i也是同樣。它們的主要區(qū)別是unsigned int變量j的起始點是0(正像里程
    11        指示表那樣),而int變量i的起始點則是-2147483648。——參考《C Primer Plus》
    12     */
    13     printf("%d %d %d\n", i, i+1, i+2);
    14     printf("%u %u %u\n", j, j+1, j+2);
    15     return 0;
    16 }
    運行結(jié)果:
    2147483647 -2147483648 -2147483647
    4294967295 0 1
    浮點數(shù)的上溢和下溢???(理解的不是很清楚,回頭再來寫)
    2、
    1 #include <stdio.h>
    2 int main(void)
    3 {
    4     int asc;
    5     printf("Please enter an ASCII value: ");
    6     scanf("%d", &asc);
    7     printf("The code is %c.\n", asc);
    8     return 0;
    9 }
    3、
    1 #include <stdio.h>
    2 int main(void)
    3 {
    4     printf("\aStartled by the sudden sound, Sally shouted, ");
    5     printf("\"By the Great Pumpkin,what was that!\"\n");
    6     return 0;
    7 }
    4、
    1 #include <stdio.h>
    2 int main(void)
    3 {
    4     float number;
    5     printf("Please enter a float value: ");
    6     scanf("%f", &number);
    7     printf("The input is %f or %e", number, number);
    8     return 0;
    9 }
    5、
    1 #include <stdio.h>
    2 int main(void)
    3 {
    4     int age;
    5     printf("Please enter your age: ");
    6     scanf("%d", &age);
    7     printf("Your age has %e s", age*3.156e7);
    8     return 0;
    9 }
    6、
    1 #include <stdio.h>
    2 int main(void)
    3 {
    4     int num; // 夸脫數(shù)應(yīng)該為整數(shù)吧!!
    5     printf("Please enter water: ");
    6     scanf("%d", &num);
    7     printf("The water has %e ", num*950/3.0e-23);
    8     return 0;
    9 }
    7、
    1 #include <stdio.h>
    2 int main(void)
    3 {
    4     float height;
    5     printf("Please enter your height: ");
    6     scanf("%f", &height);
    7     printf("Your height is %.2f cm.\n", height*2.54);
    8     return 0;
    9 }
    posted @ 2015-10-31 22:22 李阿昀 閱讀(1420) | 評論 (0)編輯 收藏

    第2章 C語言概述
    復(fù)習(xí)題
    1、如何稱呼C程序的基本模塊?
    答:它們被稱為函數(shù)。
    2、什么是語法錯誤?給出它的一個英語例子和C語言例子。 
    答:C的語法錯誤是指把正確的C符號放在了錯誤的位置。這是英語中的一個例子:"Me speak English good.";這是C語言的一個例子:printf "Where are the parentheses?";
    3、什么是語義錯誤?給出它的一個英語例子和C語言例子。
    答:語義錯誤就是在意思上的錯誤。這是英語中的一個例子:"The sentence is excellent Italian.";這是C語言中的一個例子:thrice_n = 3 + n;
    4、Indiana Sloth 已經(jīng)編好了下面的程序,并想征求你的意見。請幫助他評定。
    1 include studio.h
    int main{void/*該程序可顯示出一年中有多少周/*
    3 (
    4 int s

    6 s: = 56;
    7 print(There are s weeks in a year.);
    8 return 0;
    答:第1行:以一個#開始,拼寫出文件名stdio.h,然后把文件名放在一對尖括號中。
         第2行:使用(),而不是使用{};使用*/來結(jié)束注釋,而不是使用/*。
         第3行:使用{,而不是(。
         第4行:使用分號來結(jié)束語句。
         第5行:Indiana使這一行(空白行)正確!
         第6行:使用=,而不是使用:=進行賦值(顯然,Indiana 了解一些Pascal)。每年有52周而不是56周。
         第7行:應(yīng)該是printf("There are %d weeks in a year.\n",s);
         第9行:源程序沒有第9行,但是應(yīng)該有,它應(yīng)該包含一個結(jié)束花括號}。
    在進行這些修改之后,代碼如下:
    1 #include<stdio.h>
    int main(void/*該程序可顯示出一年中有多少周/*
    3 {
    4 int s;

    6 s = 52;
    7 printf("There are %d weeks in a year.\n",s);
    8 return 0;
    9 }
    5、假設(shè)下面的每一個例子都是某個完整程序的一部分,它們每個將輸出什么結(jié)果?
    a.printf("Baa Baa Black Sheep.");
       printf("Have you any wool?\n");
    b.printf("Begone!\n0 creature of lard!");
    c.printf("What?\nNo/nBonzo?\n");
    d.int num;

      num = 2;
      printf("%d + %d = %d",num,num,num + num);
    答:a.Baa Baa Black Sheep.Have you any wool?(注意:在句號之后沒有空格。)
         b.Begone!
            0 creature of lard!(注意光標(biāo)仍留在第2行結(jié)束處。)
         c.What?
            No/nBonzo?(注意斜線符號”/“沒有反斜線符號”\“所具有的作用,它只是簡單地作為斜線符號被打印出來。)
         d.2 + 2 = 4
    6、下面哪幾個是C的關(guān)鍵字?main,int,function,char,=
    答:int,char(注意main只是一個函數(shù)名,函數(shù)是C中的一個技術(shù)術(shù)語。=是一個運算符)
    7、如何以下面的格式輸出words和lines的值:"There were 3020 words and 350 lines"?這里,3020和350代表兩個變量的值。
    答: 
     1 #include <stdio.h>
     2
     int main(void)
     3 {
     4     int num1,num2;
     5     num1 = 3020;
     6     num2 = 350;
     7 
     8     printf("There were %d words and %d lines\n",num1,num2);
     9     return 0;
    10 }
    8、考慮下面的程序:
     1 #include <stdio.h>
     2 int main(void)
     3 {
     4     int a, b;
     5 
     6     a = 5;
     7     b = 2; /*第7行*/
     8     b = a; /*第8行*/
     9     a = b; /*第9行*/
    10     printf("%d %d\n", b, a);
    11     return 0;
    12 }
    請問在第7行、第8行和第9行之后程序的狀態(tài)分別是什么?
    答:第7行之后,a為5,b為2。第8行之后,a為5,b為5。第9行之后,a為5,b為5。
    編程練習(xí)(新手初學(xué),僅供參考!!!)
    1、
    1 #include <stdio.h>
    2 int main(void)
    3 {
    4     printf("Li Ayun\n");
    5     printf("Li\nAyun\n");
    6     printf("Li ");
    7     printf("Ayun\n");
    8     return 0;
    9 }
    2、
    1 #include <stdio.h>
    2 int main(void)
    3 {
    4     printf("My name is Li Ayun!\n");
    5     printf("I live in BeiJing now!\n");
    6     return 0;
    7 }
    3、
    1 #include <stdio.h>
    2 int main(void)
    3 {
    4     int age;
    5     age = 23;
    6     printf("age = %d, days = %d\n", age, age * 365);
    7     return 0;
    8 }
    4、
     1 #include <stdio.h>
     2 void show(void);
     3 void end(void);
     4 int main(void)
     5 {
     6     show();
     7     show();
     8     show();
     9     end();
    10     return 0;
    11 }
    12 void show(void)
    13 {
    14    printf("For he's a jolly good fellow!\n");
    15 }
    16 void end(void)
    17 {
    18     printf("Which nobody can deny!\n");
    19 }
    5、
    1 #include <stdio.h>
    2 int main(void)
    3 {
    4     int toes;
    5     toes = 10;
    6 
    7     printf("toes = %d\ntoes + toes = %d\ntoes * toes = %d", toes, toes + toes, toes * toes);
    8     return 0;
    9 }
    6、
     1 #include <stdio.h>
     2 void showSmile(void);
     3 int main(void)
     4 {
     5     showSmile();
     6     showSmile();
     7     showSmile();
     8     printf("\n");
     9     showSmile();
    10     showSmile();
    11     printf("\n");
    12     showSmile();
    13     return 0;
    14 }
    15 void showSmile(void)
    16 {
    17     printf("Smile!");
    18 }
    7、
     1 #include <stdio.h>
     2 void one_three(void);
     3 void two(void);
     4 int main(void)
     5 {
     6     printf("starting now:\n");
     7     one_three();
     8     two();
     9     printf("done!");
    10     return 0;
    11 }
    12 void one_three(void)
    13 {
    14     printf("one\n");
    15 }
    16 void two(void)
    17 {
    18     printf("two\nthree\n");
    19 }

    posted @ 2015-10-28 20:22 李阿昀 閱讀(392) | 評論 (0)編輯 收藏

    第1章  概覽
       復(fù)習(xí)題
       1、就編程而言,可移植性表示什么?
       答:可移植性意味著在一個系統(tǒng)上編寫的C程序經(jīng)過很少改動或不經(jīng)修改就可以在其他系統(tǒng)上運行。如果修改是必要的,則通常只須改變伴隨主程序的一個頭文件(header)中的幾項內(nèi)容即可。
       2、解釋源代碼文件、目標(biāo)代碼文件和可執(zhí)行文件之間的區(qū)別。
       答:源代碼文件中包含著程序員使用任何語言編寫的代碼。目標(biāo)代碼文件包含著機器語言代碼,它并不需要是完整的程序代碼。可執(zhí)行文件包含著組成可執(zhí)行程序的全部機器語言代碼。
       3、編程的7個主要步驟是什么?
       答:第1步:定義程序目標(biāo)
             第2步:設(shè)計程序
             第3步:編寫代碼
             第4步:編譯
             第5步:運行程序
             第6步:調(diào)試 
             第7步:維護和修改程序
       4、編譯器的任務(wù)是什么?
       答:編譯器把源代碼(例如,用C語言寫成的代碼)轉(zhuǎn)換成機器語言代碼,也稱對象代碼。
       5、鏈接器的任務(wù)是什么?
       答:鏈接器把多個來源(例如,已編寫的源代碼、庫代碼和啟動代碼)的目標(biāo)代碼連接成一個單獨的可執(zhí)行程序。
       編程練習(xí)
       1、
     1 #include <stdio.h>
     2
     int main(void)
     3 {
     4     float feet,cm;
     5 
     6     printf("Please enter your feet:");
     7     scanf("%f",&feet);
     8     cm = feet * 2.54;
     9     printf("So you have %.2f cm!\n",cm);
    10    return 0;
    11 }
    posted @ 2015-10-28 19:39 李阿昀 閱讀(279) | 評論 (0)編輯 收藏

    主站蜘蛛池模板: 精品亚洲AV无码一区二区三区| 亚洲av无码乱码在线观看野外| 亚洲国产精品一区二区久久hs| 无码AV动漫精品一区二区免费| 国产在线观看免费完整版中文版 | 亚洲高清在线播放| 精品国产污污免费网站| 亚洲av无码av制服另类专区| 一级毛片免费毛片一级毛片免费| 久久精品国产亚洲夜色AV网站| 精品无码无人网站免费视频| 亚洲综合久久久久久中文字幕| 日本XXX黄区免费看| 亚洲成a人无码亚洲成av无码| 免费又黄又爽的视频| 久久九九久精品国产免费直播| 亚洲成色WWW久久网站| 精品一区二区三区无码免费视频| 亚洲伊人色一综合网| 日本免费网站在线观看| 一级做a爰片久久免费| 久久99国产亚洲精品观看| 91精品免费国产高清在线| 亚洲成a人片在线不卡一二三区 | 100000免费啪啪18免进| 亚洲欧美成aⅴ人在线观看| 亚洲AV成人潮喷综合网| 一个人免费视频在线观看www| 亚洲欧洲精品久久| 国产无遮挡色视频免费视频| 成人无码区免费A∨直播| 亚洲毛片在线免费观看| www国产亚洲精品久久久日本| 久久久久久AV无码免费网站下载| 亚洲午夜一区二区三区| 亚洲一级片免费看| 国产成人精品免费视频动漫| 手机永久免费的AV在线电影网| 噜噜噜亚洲色成人网站∨| 国产公开免费人成视频| 精品一区二区三区免费毛片爱|