日本一本亚洲最大|日本午夜免费啪视频在|国产自产在线视频一区|亚洲福利精品视频

    <object id="4ihfc"></object>
      
      
    1. <object id="4ihfc"></object>
    2. 我要投稿 投訴建議

      計算機(jī)等級考試三級上機(jī)題庫練習(xí)及答案(7)

      時間:2023-02-11 21:44:02 計算機(jī)等級 我要投稿
      • 相關(guān)推薦

      2006年計算機(jī)等級考試三級上機(jī)題庫練習(xí)及答案(7)

      第13題:

      函數(shù)ReadDat()實現(xiàn)從文件in13.dat中讀取一篇英文文章存入字符串?dāng)?shù)組xx中;請編制函數(shù)StrOR(),其函數(shù)的功能是:以行為單位依次把字符串中所有小寫字母o左邊的字符串內(nèi)容移到該串的右邊存放,然后把小寫字母o刪除,余下的字符串內(nèi)容移到已處理字符串的左邊存放,之后把已處理的字符串仍按行重新存入字符串?dāng)?shù)組xx中。最后main()函數(shù)調(diào)用函數(shù)WriteDat()把結(jié)果xx輸出到文件out13.dat中。
      例如:原文:you can create an index on any field.
      you have the correct record.
      結(jié)果:n any field.Yu can create an index
      rd.yu have the correct rec
      原始數(shù)據(jù)文件存放的格式是:每行的寬度均小于80個字符,含標(biāo)點符號和空格。
      注意:部分源程序已經(jīng)給出。
      請勿改動主函數(shù)main()、讀數(shù)據(jù)函數(shù)ReadDat()和輸出數(shù)據(jù)函數(shù)WriteDat()的內(nèi)容。
      #include
      #include
      #include
      char xx[50][80];
      int maxline=0; /* 文章的總行數(shù) */
      int ReadDat(void);
      void WriteDat(void);
      void StrOR(void)
      {


      }
      void main()
      { clrscr();
      if(ReadDat())
      { printf("數(shù)據(jù)文件in13.dat不能打開!n007");
      return;
      }
      StrOR();
      WriteDat();
      }
      int ReadDat(void)
      { FILE *fp;
      int i=0;
      char *p;
      if((fp=fopen("in13.dat","r"))==NULL)
      return 1;
      while(fgets(xx[i],80,fp)!=NULL)
      { p=strchr(xx[i],#39;n#39;);
      if(p) *p=0;
      i++;
      }
      maxline=i;
      fclose(fp);
      return 0;
      }
      void WriteDat(void)
      { FILE *fp;
      int i;
      clrscr();
      fp=fopen("out13.dat","w");
      for(i=0;i{
      printf("%sn",xx[i]);
      fprintf(fp,"%sn",xx[i]);
      }
      fclose(fp);
      }

      http://krishna123.com/

      【計算機(jī)等級考試三級上機(jī)題庫練習(xí)及答案(7)】相關(guān)文章:

      2006年計算機(jī)等級考試三級上機(jī)題庫練習(xí)及答案(6)07-23

      2006年計算機(jī)等級考試三級上機(jī)題庫練習(xí)及答案(5)07-23

      計算機(jī)等級考試JAVA試題練習(xí)及答案07-18

      計算機(jī)等級考試三級(C語言)上機(jī)考試試題總結(jié)08-10

      計算機(jī)等級考試三級網(wǎng)絡(luò)技術(shù)上機(jī)模擬試題08-02

      計算機(jī)等級考試及答案08-03

      計算機(jī)等級考試答案08-03

      計算機(jī)等級考試一級ps考前練習(xí)及答案07-20

      07年4月全國計算機(jī)等級考試三級PC上機(jī)試題07-23