久久久国产精品秘人口麻豆|永久免费AV无语国产|人成电影免费中文字幕|久久AV嫩草影院2

    1. <dfn id="yitbn"><samp id="yitbn"><progress id="yitbn"></progress></samp></dfn>

          <div id="yitbn"></div>

          1. 查看全部128種考試
            軟件水平考試
             考試動態(tài) 報考指南 歷年真題 模擬試題 復習資料 心得技巧 專業(yè)英語 技術文章 軟考論壇 考試用書
             程序員 軟件設計師 網(wǎng)絡管理員 網(wǎng)絡工程師 系統(tǒng)分析師 數(shù)據(jù)庫系統(tǒng)工程師
            1
            2
            3
            4
            5
            6
            7
            8
            9
            10
            admin  
            【字體: 1994年程序員考試-下午試題
            1994年程序員考試-下午試題
            spks.eeeigo.com 來源:考試吧(eeeigo.com) 更新:2004-9-9 16:22:00 軟件水平考試 考試論壇

            【程 序】

             #define MAXSCORE 20

            #define QUESTION 10

            #define ORDERS 5

            main()

            { int p[QUESTION]={0,0,0,0,0,0,0,0,0,0},

            n[QUESTION]={0,0,0,0,0,0,0,0,0,0},

            s[QUESTION]={0,0,0,0,0,0,0,0,0,0};

            int f[ORDERS]={0,0,0,0,0};

            int i,score,c,number,pn=0;

            char fig,ch[120];

            char *title[]={" 90 -- 100 A",

            " 80 -- 89 B",

            " 70 -- 79 C",

            " 60 -- 69 D",

            " 0 -- 59 E"}

            while(1)

            {

            printf("Enter number && score1 -- score10 \n");

            if (scanf("%d",&number) ==0)

            {

            gets(ch);

            printf("Error! Input again!\n");

            continue;

            }

            for (c=0,i=1;i<QUESTION && c== i; i++)

            if (scanf("%d",&p[i]))

            if (p[i] <= MAXSCORE)

            _________________________ ;

            if ( ______________________ )

            {

            gets(ch);

            printf("Error! Input again!\n");

            continue;

            }

            for (c=0,score=0,i=0;i<QUESTION;i++)

            if ( _______________ )

            {

            c++; score +=p[i]; n[i]++; s[i] +=p[i];

            }

            fig = (score ==100) ? 'A': (score < 60) ? _____________________;

            f[ _______ ]++; pn++;

            printf("Number = %d Score = %d Mark = %c\n",number,score,fig);

            }

            printf("STUDENTS = %d\n",pn);

            for (i=0;i<ORDERS;i++) printf("%s%7d\n",title[i],f[i]);

            printf("\n Question Students Average\n");

            for (i=0;i<QUESTION;i++)

            if (n[i]) printf("%6d%10d%10.2f\n",i+1,n[i], _______________ );

            else pritnf ("6d%10d%10s\n",i+1,n[i]," --");

            }

             

            本程序實現(xiàn)安照每頁寬80列平均分左右兩欄的格式

            印出正文文件內容.

            程序引入數(shù)組buff[] [] [] 和ln [] [], 將從文件

            讀出的字符按行存儲于buff[0],行號存于ln[0](對應左欄

            ), 或buff[1],ln[1](對應右欄).約定,文件內容先填左欄

            填滿后,再填右欄.或左右兩欄填滿,或文件內容填完,輸出

            一頁的內容.

            欲輸出的正文文件(小于1000行)的文件名作為主函數(shù)

            的參數(shù).主函數(shù)以文件名為參數(shù)調用函數(shù)dprint()輸出一個

            文件.函數(shù)dprint()讀取文件內容,控制欄中的一行內容的

            填寫,當一行填滿時,調用函數(shù)nextline().函數(shù)nextline()

            控制欄中行的變化,左右欄的變化.待左右欄都填滿時,調用

            函數(shù)printout()完成整頁輸出.函數(shù)printout()完成頁面排

            版,取ln[0] buff[0]和ln[1] buff[1],將對應行號及內容

            填入line[],逐行輸出.

            【程 序】

            #include <stdio.h>

            #define LL 80

            #define COL 2

            #define CSIZE LL/COL-9

            #define PL 50

            #define MARGIN 3

            char buff[COL][PL][CSIZE];

            int ln[COL][PL];

            int col,row,p;

            dprint(char *fname)

            { FILE *fp;

            int lin,c;

            if ((fp=fopen(fname,"r"))==NULL) return;

            lin =0; p=0; col=0; c=getc(fp);

            while (c!=EOF)

            { ln[col][row]=++lin;

            while (c != '\n' && c != EOF)

            { if (p>= CSIZE)

            {

            _________________ ; ln[col][row] = 0;

            }

            _________________ = c ; c = getc(fp);

            }

            ____________________ ;

            if (c != EOF) c = getc(fp);

            }

            while( col != 0 || row != 0 )

            { ln[col][row] = 0;

            nextline();

            }

            fclose(fp);

            }

            nextline()

            { while(p < CSIZE)

            buff[col][row][p++] = ' ';

            if ( _____________ )

            { if ( ++col >= COL )

            { printout();

            _______________;

            }

            row = 0;

            }

            p = 0;

            }

            printout()

            { int k, i, lpos, col, d;

            char line[LL];

            for(k=0;k<MARGIN;k++) putchar('\n');

            for(k=0;k<PL;k++)

            { for(i=0;i<LL-1;i++)

            for(lpos=0,col=0;col<COL;lpos += CSIZE+9,

            col++)

            { d = _____________;

            p = lpos + 4;

            while (d>0)

            { line[p--] = _______________;

            d /= 10;

            }

            for(p=lpos+7,i=0;i<CSIZE;i++)

            line[p++] = buff[col][k][i];

            }

            puts(line);

            }

            for(k=0;k<MARGIN;k++) putchar('\n');

            }

            main(int argc, char **argv)

            { int f;

            for(f=1;f<argc;f++)

            dprint(argc[f]);

            }

            本程序給出兩個函數(shù).函數(shù)create()根據(jù)已知整數(shù)數(shù)組構造一個線性鏈表.函

            數(shù)sort()采用選擇排序方法對已知鏈表進行排序.為排序方便,函數(shù)sort()于排

            序前在鏈表首表元之前生成一個輔助表元.排序完成后,將該輔助表元篩去.

            【程 序】

            #include <stdio.h>

            #include <stdlib.h>

            struct node{

            int value;

            struct node *next;

            };

            struct node *create(int a[], int n)

            { struct node *h, *q;

            for(h=NULL;n;n--)

            { q = (struct node *)malloc(sizeof(struct node));

            q->value = ____________;

            ______________;

            ______________;

            }

            return h;

            }

            void sort(struct node **h)

            { struct node *p,*q,*r,*s,*hl;

            hl = p = (struct node*)malloc(sizeof(struct node));

            p->next = *h;

            while(p->next != NULL)

            { q = p->next;

            r = p;

            while(p->next != NULL)

            { if (q->next->value < __________ )

            r = q;

            q = q->next;

            }

            if( r != p )

            { s = ____________;

            _____________ = s->next;

            s->next = ___________;

            ___________ = s;

            }

            p = p->next;

            }

            *h = hl->next;

            free(hl);

            }

            int text_data[] = {5,9,3,4,5,7,8};

            main()

            { struct node *h, *p;

            h = create(test_data,

            sizeof test_data/size of test_data);

            for(p=h;p;p=p->next) printf("%5d",p->value);

            printf("\n");

            sort(&h);

            for(p=h;p;p=p->next) printf("%5d",p->value);

            printf("\n");

            }

            轉帖于:軟件水平考試_考試吧
            文章搜索  
            看了本文的網(wǎng)友還看了:
            軟件水平考試權威輔導教材: 訂書電話:010-62168566  更多>>>
            網(wǎng)友評論
            昵 稱: *  評 分: 1分 2分 3分 4分 5分
            標題:   匿名發(fā)表    (共有條評論)查看全部評論>>
            版權聲明 -------------------------------------------------------------------------------------
              如果軟件水平考試網(wǎng)所轉載內容不慎侵犯了您的權益,請與我們聯(lián)系,我們將會及時處理。如轉載本軟件水平考試網(wǎng)內容,請注明出處。
            關于本站  網(wǎng)站聲明  廣告服務  聯(lián)系方式  付款方式  站內導航  客服中心  友情鏈接  考試論壇  網(wǎng)站地圖
            Copyright © 2004-2008 考試吧軟件水平考試網(wǎng) All Rights Reserved    
            中國科學院研究生院權威支持(北京) 電 話:010-62168566 傳 真:010-62192699
            百度大聯(lián)盟黃金認證  十佳網(wǎng)絡教育機構  經(jīng)營許可證號:京ICP060677