<address id="ousso"></address>
<form id="ousso"><track id="ousso"><big id="ousso"></big></track></form>
  1. 試題

    計算機二級考試C語言模擬試題一參考答案

    時間:2025-04-22 04:22:19 試題 我要投稿
    • 相關推薦

    2015年計算機二級考試C語言模擬試題(一)參考答案

      第一題:

    2015年計算機二級考試C語言模擬試題(一)參考答案

      1、C 2、C 3、D 4、B 5、D 、6、A 7、C 8、C 9、D 10、A

      11、C 12、C 13、D 14、C 15、B 16、C 17、D 18、D 19、C 20、B

      第二題:

      (1) 3.141593,3.1416,3.142

      (2) 6,8

      (3) 4

      (4) 22

      (5) 19

      第三題:

      1、scanf(“%f”,&f); sum+=f;

      2、fopen(“myfile”,w) fclose(fp);

      3、x>=0.0 x<=amin

      第四題:

      1、main()

      {int a,b,c;

      printf(“請輸入三個整數:”);

      scanf(“%d,%d,%d”,&a,&b,&c);

      if(aif(belse printf(“max=%d\n”,b);

      else if(aelse printf(“max=%d\n”,a); }

      2、#include”stdio.h”

      main()

      {int I,n;

      for(n=0,I=1900;I<=2000;I++)

      {if(I%4==0&&I0!=0||I@0==0)

      {printf(“%d ”,I); n++; }

      if(n%3==0)

      printf(“\n”); } } }

      3、#include”stdio.h”

      int fun(int a)

      {int I;

      if(a==2) return 1; I=2;

      while((a%I)!=0&&I<=sqrt((float)a))

      I++;

      if(a%I==0)

      {printf(“%d is not a prime!”,a);

      return 0; }

      printf(“%d is a prime!”,a);

      return 1; }

      main()

      {int x;

      printf(“\n please enter a number:”);

      scanf(“%d”,&x);

      printf(“%d\n”,fun(x)); }

      4、#include"stdio.h"

      #define N 3

      struct student

      {long stu_num; char sex;

      char name[15]; int score[4];

      float average; };

      main()

      {int I,j,index; float sum,max;

      struct student stuarr[N];

      for(I=0;I{printf("please input %d student information:\n",I+1);

      scanf("%ld,%c,%s",&stuarr[I].stu_num,&stuarr[I].sex,stuarr[I].name);

      for(j=0;j<4;j++)

      scanf("%d",&stuarr[I].score[j]); }

      for(I=0;I{sum=0.0;

      for(j=0;j<4;j++)

      sum+=stuarr[I].score[j];

      stuarr[I].average=sum/4.0; }

      max=stuarr[0].average;

      index=0;

      for(I=1;Iif(stuarr[I].average>max)

      {max=stuarr[I].average;

      index=I; }

      printf("總平均成績最高的學生信息是學號=%ld,性別=%c,姓名=%s,平均成績=%4.1f\n",stuarr[index].stu_num,stuarr[index].sex,stuarr[index].name,stuarr[index].average);

      }

    【計算機二級考試C語言模擬試題一參考答案】相關文章:

    最新計算機二級考試C語言模擬試題09-28

    計算機二級《C語言》考試模擬試題與答案07-21

    計算機二級C語言模擬試題09-06

    2015年計算機二級考試C語言模擬試題(三)參考答案09-10

    2015年計算機二級考試C語言模擬試題(六)參考答案09-16

    2015年計算機二級考試C語言模擬試題(二)參考答案08-02

    2015年計算機二級考試C語言模擬試題(五)參考答案05-30

    2015年計算機二級考試C語言模擬試題(一)07-25

    計算機二級C語言模擬試題及答案07-04

    <address id="ousso"></address>
    <form id="ousso"><track id="ousso"><big id="ousso"></big></track></form>
    1. 日日做夜狠狠爱欧美黑人