亚洲欧洲国产欧美一区精品,激情五月亚洲色五月,最新精品国偷自产在线婷婷,欧美婷婷丁香五月天社区

      自考

      各地資訊
      當前位置:考試網(wǎng) >> 自考 >> 自考真題 >> 工學類 >> C語言程序設(shè)計 >> 文章內(nèi)容

      排行熱點

      • 歷年真題
      • 模擬試題
      • 自考自答

      全國2009年1月自學考試C++程序設(shè)計試題_第6頁

      來源:考試網(wǎng)  [2009年5月13日]  【

      五、程序分析題(本大題共4小題,每小題5分,共20分)
      51.請寫出myTextl.txt文本文件中的內(nèi)容
      #include
      #include
      using namespace std;
      #include
      void main()
      {
      ofstream myFile1;
      myFilel.open("myTextl.txt");
      cout<<"Enter the data in Chinese format(e.g. ,2008,May 25):"<string Date("2008,January 1");
      string Year=Date.substr(0,4);
      int k=Date.find(",");
      int i=Date.find(" ");
      string Month=Date.substr(k+l,i-k-1);
      string Day=Date.substr(i+1,2);
      string NewDate=Day+" "+Month+" "+Year;
      myFilel<<"original date:"<myFile1<<"Converted date:"<myFilel.close();
      }
      52.給出下面程序的輸出結(jié)果
      #include
      using namespace std;
      class Simple
      {
      int x,y;
      public:
      Simple(){x=y=0;}
      Simple(int i,int j){x=i;y=j;}
      void copy(Simple&s);
      void setxy(int i,int j){x=i;y=j;}
      void print(){cout<<"x="<

      首頁 1 2 3 4 5 6 尾頁
      責編:admin

      相關(guān)文章