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

      自考

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

      排行熱點(diǎn)

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

      全國(guó)2012年1月自學(xué)考試C++程序設(shè)計(jì)試題_第4頁(yè)

      來(lái)源:考試網(wǎng) [ 2013年11月23日 ] 【大 中 小】

      三、改錯(cuò)題(本大題共5小題,每小題2分,共10分)

      下面的類定義中有一處錯(cuò)誤,請(qǐng)用下橫線標(biāo)出錯(cuò)誤所在行并給出修改意見(jiàn)。

      41.#include<iostream.h>

      main(){

      int x=9,y=8,z=7;

      const int * p=z;

      cout<< * p<<endl;

      }

      42.#include<iostream.h>

      main(){

      int x=8,y=6;

      const int*const p=&x;

      p=&y;

      cout<<* p<<endl;

      }

      43.#include<iostream.h>

      main(){

      folat p;

      p=new folat[5];

      for(int i=0;i<5;i++)

      {cin>> * (p+i);cout<< * (p+i)<<endl;}

      delete p;

      }

      44.template<class T>

      T f(T x){

      T y;

      y=x+T;

      return y;

      }

      45.#include<iostream.h>

      class point{

      int x;

      public:void init(int a){x=a;}

      int getx(){return x;}

      void setx(int a){x=a;}

      };

      main(){

      point a;

      a.init(20,30);

      cout<<a.getx()<<endl;

      }

      責(zé)編:may1205