亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? chapter 1.txt

?? c primer 部分習(xí)題答案
?? TXT
?? 第 1 頁 / 共 5 頁
字號:
    }
    if ((f1 = fopen(argv[1], "r")) == NULL)
    {
        printf("Could not open file %s for input\n", argv[1]);    
        exit(EXIT_FAILURE);
    }
    if ((f2 = fopen(argv[2], "r")) == NULL)
    {
        printf("Could not open file %s for input\n", argv[2]);    
        exit(EXIT_FAILURE);
    }
    ch1 = getc(f1);
    ch2 = getc(f2);
    
    while (ch1 != EOF || ch2 != EOF)
    {
        while (ch1 != EOF && ch1 != '\n') /* skipped after EOF reached */
        {
            putchar(ch1);
            ch1 = getc(f1);
        }
        if (ch1 != EOF)
        {
            if (ch2 == EOF)
                putchar('\n');
            else
                putchar(' ');
            ch1 = getc(f1);
        }
        while (ch2 != EOF && ch2 != '\n') /* skipped after EOF reached */
        {
            putchar(ch2);
            ch2 = getc(f2);
        }
 
        if (ch2 != EOF)
        {
            putchar('\n');
            ch2 = getc(f2);
        }
    }
        
    if (fclose(f1) != 0)
        printf("Could not close file %s\n", argv[1]);    
    if (fclose(f2) != 0)
        printf("Could not close file %s\n", argv[2]);    
        
    return 0;
}
 
PE 13-9
 
/* Programming Exercise 13-9 */
/* to simplify accounting, store one number and word per line */
 
#include <stdio.h>
#include <stdlib.h>
#define MAX 40
 
int main(void)
{
     FILE *fp;
     char words[MAX];
     int wordct = 0;
 
     if ((fp = fopen("wordy", "a+")) == NULL)
     {
          fprintf(stderr,"Can't open \"words\" file.\n");
          exit(1);
     }
     /* determine current number of entries */
     rewind(fp);
     while (fgets(words, MAX - 1, fp) != NULL)
         wordct++;
     rewind(fp);
     
     puts("Enter words to add to the file. Enter one word per line, and ");
     puts("press the Enter key at the beginning of a line to terminate.");
     while (gets(words) != NULL  && words[0] != '\0')
          fprintf(fp, "%d: %s\n", ++wordct, words);
     puts("File contents:");
     rewind(fp);           /* go back to beginning of file */
     while (fgets(words, MAX - 1, fp) != NULL)
          fputs(words, stdout);
     if (fclose(fp) != 0)
          fprintf(stderr,"Error closing file\n");
 
     return 0;
}
 
PE 13-11
 
/* Programming Exercise 13-11 */
 
#include <stdio.h>
#include <stdlib.h>
#include <console.h>    /* Macintosh adjustment */
 
#define SLEN 256
const char *errmesg[] = {"Usage: %s string filename]\n",
                         "Can't open file %s\n" };
            
int main(int argc, char *argv[])
{
    FILE *fp;
    char line[SLEN];
 
    argc = ccommand(&argv);   /* Macintosh adjustment */  
    if (argc != 3)
    {
        fprintf(stderr, errmesg[0], argv[0]);
        exit(EXIT_FAILURE);
    }
 
    if ((fp = fopen(argv[2], "r")) == NULL)
    {
        fprintf(stderr, errmesg[1], argv[2]);
        exit(EXIT_FAILURE);
    }
    
    while (fgets(line, SLEN - 1, fp) != NULL)
    {
        if (strstr(line, argv[1]) != NULL)
            fputs(line, stdout);
    }
        
    fclose(fp);
 
    return 0;
}
 
PE 13-12
 
Data for program:
0 0 9 0 0 0 0 0 0 0 0 0 5 8 9 9 8 5 2 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 9 0 0 0 0 0 0 0 5 8 9 9 8 5 5 2 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 5 8 1 9 8 5 4 5 2 0 0 0 0 0 0 0 0 0
0 0 0 0 9 0 0 0 0 0 0 0 5 8 9 9 8 5 0 4 5 2 0 0 0 0 0 0 0 0
0 0 9 0 0 0 0 0 0 0 0 0 5 8 9 9 8 5 0 0 4 5 2 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 5 8 9 1 8 5 0 0 0 4 5 2 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 5 8 9 9 8 5 0 0 0 0 4 5 2 0 0 0 0 0
5 5 5 5 5 5 5 5 5 5 5 5 5 8 9 9 8 5 5 5 5 5 5 5 5 5 5 5 5 5
8 8 8 8 8 8 8 8 8 8 8 8 5 8 9 9 8 5 8 8 8 8 8 8 8 8 8 8 8 8
9 9 9 9 0 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 3 9 9 9 9 9 9 9
8 8 8 8 8 8 8 8 8 8 8 8 5 8 9 9 8 5 8 8 8 8 8 8 8 8 8 8 8 8
5 5 5 5 5 5 5 5 5 5 5 5 5 8 9 9 8 5 5 5 5 5 5 5 5 5 5 5 5 5
0 0 0 0 0 0 0 0 0 0 0 0 5 8 9 9 8 5 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 5 8 9 9 8 5 0 0 0 0 6 6 0 0 0 0 0 0
0 0 0 0 2 2 0 0 0 0 0 0 5 8 9 9 8 5 0 0 5 6 0 0 6 5 0 0 0 0
0 0 0 0 3 3 0 0 0 0 0 0 5 8 9 9 8 5 0 5 6 1 1 1 1 6 5 0 0 0
0 0 0 0 4 4 0 0 0 0 0 0 5 8 9 9 8 5 0 0 5 6 0 0 6 5 0 0 0 0
0 0 0 0 5 5 0 0 0 0 0 0 5 8 9 9 8 5 0 0 0 0 6 6 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 5 8 9 9 8 5 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 5 8 9 9 8 5 0 0 0 0 0 0 0 0 0 0 0 0
 
/* Programming Exercise 13-12 */
#include <stdio.h>
#include <stdlib.h>
 
#define ROWS    20
#define COLS    30
#define LEVELS    10
const char trans[LEVELS + 1] = " .':~*=&%@";
 
void MakePic(int data[][COLS], char pic[][COLS], int rows);
void init(char arr[][COLS], char ch);
 
int main()
{
    int row, col;
    int picIn[ROWS][COLS];
    char picOut[ROWS][COLS];
    char fileName[40];
    FILE * infile;
    
    init(picOut, 'S');
    
    printf("Enter name of file: ");
    scanf("%s", fileName);
    if ((infile = fopen(fileName, "r")) == NULL)
    {
        fprintf(stderr, "Could not open data file.\n");
        exit(EXIT_FAILURE);
    }
    
    for (row = 0; row < ROWS; row++)
        for (col = 0; col < COLS; col++)
            fscanf(infile, "%d",  &picIn[row][col]);
    if (ferror(infile))
    {
        fprintf(stderr, "Error getting data from file.\n");
        exit(EXIT_FAILURE);
    }
    MakePic(picIn, picOut, ROWS);
 
    for (row = 0; row < ROWS; row++)
    {
        for (col = 0; col < COLS; col++)
            putchar(picOut[row][col]);
        putchar('\n');
    }
    return 0;
}
 
void init(char arr[][COLS], char ch)
{
    int r, c;
    for (r = 0; r < ROWS; r++)
        for (c = 0; c < COLS; c++)
            arr[r][c] = ch;
}
 
void MakePic(int data[][COLS], char pic[][COLS], int rows)
{
    int row, col;
    for (row = 0; row < rows; row++)
        for (col = 0; col < COLS; col++)
            pic[row][col] = trans[data[row][col]];
}
 
Chapter 14
 
PE 14-1
 
/* pe14-1.c  */
#include <stdio.h>
#include <string.h>
#include <ctype.h>
 
struct month {
    char name[10];
    char abbrev[4];
    int days;
    int monumb;
};
 
const struct month months[12] = {
    {"January", "Jan", 31, 1},
    {"February", "Feb", 28, 2},
    {"March", "Mar", 31, 3},
    {"April", "Apr", 30, 4},
    {"May", "May", 31, 5},
    {"June", "Jun", 30, 6},
    {"July", "Jul", 31, 7},
    {"August", "Aug", 31, 8},
    {"September", "Sep", 30, 9},
    {"October", "Oct", 31, 10},
    {"November", "Nov", 30, 11},
    {"December", "Dec", 31, 12}
};
 
int days(char * m);
int main(void)
{
    char input[20];
    int daytotal;
 
    printf("Enter the name of a month: ");
    while (gets(input) != NULL && input[0] != '\0')
    {
        daytotal = days(input);
        if (daytotal > 0)
            printf("There are %d days through %s.\n", daytotal, input);
        else
            printf("%s is not valid input.\n", input);
        printf("Next month (empty line to quit): ");
    }
    puts("bye");
    
    return 0;
}
 
int days(char * m)
{
    int total = 0;
    int mon_num = 0;
    int i;
    if (m[0] == '\0')
        total = -1;
    else
    {
        m[0] = toupper(m[0]);
        for (i = 1; m[i] != '\0'; i++)
            m[i] = tolower(m[i]);
        for (i = 0; i < 12; i++)
            if (strcmp(m, months[i].name) == 0)
            {
                mon_num = months[i].monumb;
                break;
            }
        if (mon_num == 0)
            total = -1;
        else
            for (i = 0; i < mon_num; i++)
                total +=months[i].days;
    }
    return total;
}
 
PE 14-3
 
/* pe14-3.c */
#include <stdio.h>
#include <string.h>
#define MAXTITL   40
#define MAXAUTL   40
#define MAXBKS   100            /* maximum number of books  */
struct book {                   /* set up book template     */
    char title[MAXTITL];
    char author[MAXAUTL];
    float value;
};
 
void sortt(struct book * pb[], int n);
void sortv(struct book * pb[], int n);
 
int main(void)
{
     struct book library[MAXBKS]; /* array of book structures */
     struct book * pbk[MAXBKS];   /* pointers for sorting     */
     int count = 0;
     int index;
 
     printf("Please enter the book title.\n");
     printf("Press [enter] at the start of a line to stop.\n");
     while (count < MAXBKS && gets(library[count].title) != NULL
                         && library[count].title[0] != '\0')
     {
          printf("Now enter the author.\n");
          gets(library[count].author);
          printf("Now enter the value.\n");
          scanf("%f", &library[count].value);
          pbk[count] = &library[count];
          count++;
          while (getchar() != '\n')
               continue;                /* clear input line */
          if (count < MAXBKS)
          printf("Enter the next title.\n");
     }
     printf("Here is the list of your books:\n");
     for (index = 0; index < count; index++)
         printf("%s by %s: $%.2f\n", library[index].title,
          library[index].author, library[index].value);
          
     printf("Here is the list of your books sorted by title:\n");
     sortt(pbk, count);
     for (index = 0; index < count; index++)
         printf("%s by %s: $%.2f\n", pbk[index]->title,
          pbk[index]->author, pbk[index]->value);
     sortv(pbk, count);
     printf("Here is the list of your books sorted by value:\n");
     for (index = 0; index < count; index++)
         printf("%s by %s: $%.2f\n", pbk[index]->title,
          pbk[index]->author, pbk[index]->value);
 
     return 0;
}
 
void sortt(struct book * pb[], int n)
{
   int top, search;
   struct book * temp;
 
   for (top = 0; top < n -1; top++)
       for (search = top + 1; search < n; search++)
            if (strcmp(pb[search]->title, pb[top]->title) < 0)
            {
                 temp = pb[search];
                 pb[search] = pb[top];
                 pb[top] = temp;
            }
}
 
void sortv(struct book * pb[], int n)
{
   int top, search;
   struct book * temp;
 
   for (top = 0; top < n -1; top++)
       for (search = top + 1; search < n; search++)
            if (pb[search]->value < pb[top]->value)
            {
                 temp = pb[search];
                 pb[search] = pb[top];
                 pb[top] = temp;
            }
}
 
PE 14-5
 
    /* pe14-5.c */
#include <stdio.h>
#include <string.h>
#define LEN 14
#define CSIZE 4
#define SCORES 3
struct name {
    char first[LEN];
    char last[LEN];
};
struct student {
    struct name person;
    float scores[SCORES];
    float mean;
};
void get_scores(struct student ar[], int lim);
void find_means(struct student ar[], int lim);
void show_class(const struct student ar[], int lim);
void show_ave(const struct student ar[], int lim); 
 
int main(void)
{
    struct student class[CSIZE] ={
        { "Flip", "Snide"},
        { "Clare", "Voyans"},
        { "Bingo", "Higgs"},
        { "Fawn", "Hunter"}
    };
 
    get_scores(class, CSIZE);
    find_means(class, CSIZE);
    show_class(class, CSIZE);
    show_ave(class, CSIZE);
    return 0;
}
 
void get_scores(struct student ar[], int lim)
{
    int i,j;
    for (i = 0; i < lim; i++)
    {
        printf ("Please enter %d scores for %s %s:\n", SCORES,
            ar[i].person.first, ar[i].person.last);
        for (j = 0; j < SCORES; j++)
        {
            while (scanf("%f", &ar[i].scores[j]) != 1)
            {
                scanf("%*s");
                puts("Please use numeric input.");
            }
        }
    }
}
 
void find_means(struct student ar[], int lim)
{
    int i, j;
    float sum;
    
    for (i = 0; i < lim; i++)
    {
        for (sum = 0, j = 0; j < SCORES; j++)
            sum += ar[i].scores[j];
        ar[i].mean = sum / SCORES;
    }
}
 
void show_class(const struct student ar[], int lim)
{
    int i, j;
    char wholename[2*LEN];
    
    for (i = 0; i < lim; i++)
    {
        strcpy(wholename, ar[i].person.first);
         strcat(wholename, " ");
         strcat(wholename, ar[i].person.last);
          printf("%27s: ", wholename);
          for (j = 0; j < SCORES; j++)
            printf("%6.1f ", ar[i].scores[j]);
        printf(" Average = %5.2f\n", ar[i].mean);
    }
}
 
void show_ave (const struct student ar[], int lim)
{
    int i, j;
    float total;
 
    printf("\n%27s: ", "QUIZ AVERAGES");
    for (j = 0; j < SCORES; j++)
    {
        for (total = 0, i = 0; i < lim; i++)
            total += ar[i].scores[j];
        printf("%6.2f ", total / lim);
    }
    putchar('\n');
}
 
PE 14-7
 
/* pe14-7.c */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAXTITL     40
#define MAXAUTL     40
#define MAXBKS      10         /* maximum number of books */
#define CONTINUE    0
#define DONE        1
#define YES         1
#define NO          0
struct book {                  /* set up book template    */
    char title[MAXTITL];
    char author[MAXAUTL];
    float value;
    int delete;
};
 
int getlet(const char * s);
int getbook(struct book * pb);
void update(struct book * item);
 
int main(void)
{
     struct book library[MAXBKS]; /* array of structures     */
     int count = 0;
     int deleted = 0;
     int index, filecount, open;
     FILE * pbooks;
     int size = sizeof (struct book);
 
     if ((pbooks = fopen("book.dat", "r")) != NULL)
     {
         while (count < MAXBKS &&  fread(&library[count], size,
                     1, pbooks) == 1)
         {
             if (count == 0)
                 puts("Current contents of book.dat:");
             printf("%s by %s: $%.2f\n",library[count].title,
                 library[count].author, library[count].value);
             printf("Do you wish to change or delete this entry?<y/n> ");
             if (getlet("yn") == 'y')
             {
                 printf("Enter c to change, d to delete entry: ");
                 if (getlet("cd") == 'd')
                 {
                     library[count].delete = YES;
                     deleted++;
                     puts("Entry marked for deletion.");
                 }
                 else
                     update(&library[count]);
             }
             count++;
         }
         fclose(pbooks);
     }
     filecount = count - deleted;
     if (count == MAXBKS)
     {
         fputs("The book.dat file is full.", stderr);
         exit(2);
     }
     puts("Please add new book titles.");
     puts("Press [enter] at the start of a line to stop.");
     open = 0;
     while (filecount < MAXBKS)
     {
        if (filecount < count)
        {
            while (library[open].delete == NO)
                open++;
            if (getbook(&library[open]) == DONE)
                break;
        }
        else if (getbook(&library[filecount]) == DONE)

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美高清在线一区| 国产精品入口麻豆九色| 成人一级片在线观看| 国产在线精品一区二区三区不卡| 水蜜桃久久夜色精品一区的特点| 亚洲国产精品人人做人人爽| 日韩精品电影一区亚洲| 亚洲午夜电影网| 中文字幕一区二区日韩精品绯色| 日韩一区二区在线看片| 大胆亚洲人体视频| 99久久免费精品高清特色大片| 色乱码一区二区三区88| 欧美伦理电影网| 欧美不卡一区二区| ●精品国产综合乱码久久久久| 亚洲欧美另类图片小说| 亚欧色一区w666天堂| 男男gaygay亚洲| 成人高清视频在线观看| 欧美怡红院视频| 欧美va在线播放| 成人欧美一区二区三区小说| 亚洲成人中文在线| 国产曰批免费观看久久久| 91麻豆视频网站| 欧美大片在线观看一区| 中文字幕av一区二区三区免费看| 亚洲一区二区三区中文字幕| 精品综合久久久久久8888| 成人免费黄色大片| 91精品国产色综合久久久蜜香臀| 久久丝袜美腿综合| 亚洲制服丝袜在线| 国产精品一区在线| 欧美三级韩国三级日本一级| 久久午夜色播影院免费高清| 亚洲永久免费视频| 成人黄色av电影| 日韩一区二区在线看片| 亚洲精品视频免费观看| 国产一区欧美日韩| 欧美狂野另类xxxxoooo| 最新国产の精品合集bt伙计| 国产亚洲欧美中文| 成人av网站免费| 亚洲综合一二三区| 韩国女主播一区| 91丨porny丨中文| 欧美videofree性高清杂交| 26uuu精品一区二区三区四区在线 26uuu精品一区二区在线观看 | 免费欧美高清视频| 99久久免费精品高清特色大片| 亚洲精品免费看| 亚洲精品在线免费观看视频| 日本午夜一区二区| 国产人成亚洲第一网站在线播放| 成人午夜电影小说| 亚洲综合在线电影| 日韩免费看的电影| 国产成人av电影在线观看| 亚洲免费av高清| 日韩欧美久久一区| 99久久久国产精品免费蜜臀| 午夜精品在线看| av亚洲产国偷v产偷v自拍| 日韩和欧美一区二区三区| 国产欧美一区二区精品久导航| 色94色欧美sute亚洲线路一ni | fc2成人免费人成在线观看播放 | 国产亚洲精品福利| 在线免费不卡电影| 九色综合狠狠综合久久| 亚洲色图视频免费播放| 精品国产乱码久久久久久蜜臀 | 亚洲综合色噜噜狠狠| 久久久五月婷婷| 欧美美女网站色| 成人免费高清视频| 久久99精品久久久久久动态图| 中文字幕日韩一区| 精品1区2区在线观看| 欧美三电影在线| 91色.com| a美女胸又www黄视频久久| 狠狠色伊人亚洲综合成人| 亚洲大片精品永久免费| 亚洲欧美福利一区二区| 国产日韩影视精品| 精品理论电影在线观看| 欧美日本一区二区三区四区| 99久久综合国产精品| 国产乱淫av一区二区三区| 青青草视频一区| 亚洲小少妇裸体bbw| 精品成人a区在线观看| 久久成人免费网| 五月婷婷久久综合| 91国产免费看| 久久福利视频一区二区| 日日夜夜免费精品视频| 亚洲成人久久影院| 亚洲福利视频导航| 亚洲高清免费在线| 亚洲a一区二区| 亚洲一区在线视频| 亚洲国产精品影院| 偷拍亚洲欧洲综合| 丝袜美腿一区二区三区| 亚洲自拍都市欧美小说| 一区二区激情小说| 亚洲图片有声小说| 日精品一区二区| 青青草精品视频| 麻豆国产91在线播放| 美国毛片一区二区| 亚洲自拍偷拍综合| 色美美综合视频| 国产精品影视在线| 国产成人免费视频精品含羞草妖精| 奇米精品一区二区三区四区| 麻豆中文一区二区| 国产一区二区影院| 成人黄色免费短视频| 91论坛在线播放| 欧美日韩高清一区二区三区| 在线播放国产精品二区一二区四区| 在线不卡一区二区| 26uuu色噜噜精品一区二区| 国产欧美视频在线观看| 亚洲视频一区二区在线| 日韩精品一卡二卡三卡四卡无卡| 美女视频一区在线观看| 国产风韵犹存在线视精品| 99久久99久久免费精品蜜臀| 欧美日韩一区二区三区四区五区| 日韩欧美一区二区在线视频| 久久久久久久久久看片| 亚洲精品日日夜夜| 男女男精品视频网| 成人在线视频首页| 欧美日韩国产片| 久久精品视频一区二区三区| 国产综合一区二区| 欧美一区二区三区四区在线观看| 亚洲一区二区三区激情| 日本在线不卡视频一二三区| 国产白丝精品91爽爽久久| 成人av网站免费| 国产精品一区三区| 色狠狠色噜噜噜综合网| 精品sm捆绑视频| 亚洲日本va午夜在线电影| 蜜臀久久99精品久久久久久9| 高清shemale亚洲人妖| 欧美日韩国产成人在线91| 精品毛片乱码1区2区3区| 亚洲人妖av一区二区| 九色|91porny| 欧美日韩一区不卡| 国产精品传媒入口麻豆| 精品无人码麻豆乱码1区2区 | 欧美国产1区2区| 蜜臀久久久久久久| 欧洲精品在线观看| 中文字幕欧美国产| 国内成人精品2018免费看| 亚洲美女少妇撒尿| 色激情天天射综合网| 亚洲啪啪综合av一区二区三区| 国产一区激情在线| 久久99国产精品尤物| 欧洲激情一区二区| 中文字幕一区二区三区不卡| 久久精品国产99| 在线电影欧美成精品| 亚洲美女视频一区| 91在线免费看| 国产精品久久久久9999吃药| 韩国av一区二区三区在线观看| 欧美一区二视频| 亚洲大片免费看| 精品视频免费在线| 亚洲最新在线观看| 日本二三区不卡| 亚洲免费三区一区二区| 99麻豆久久久国产精品免费| 国产精品无人区| 国产精品18久久久久久vr| 久久久久久久av麻豆果冻| 精品一区二区久久| 久久久久久亚洲综合影院红桃| 久久精品国产成人一区二区三区| 欧美视频在线观看一区| 香蕉久久夜色精品国产使用方法| 欧美在线制服丝袜| 亚洲第一久久影院| 亚洲视频综合在线| 色综合亚洲欧洲| 午夜a成v人精品|