华南俳烁实业有限公司

自考

各地資訊
當前位置:考試網(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)文章

巴彦县| 大石桥市| 美姑县| 万安县| 突泉县| 西畴县| 商城县| 淮安市| 军事| 新乡县| 论坛| 安岳县| 土默特左旗| 高邑县| 临邑县| 兴仁县| 灯塔市| 米易县| 吉木萨尔县| 河池市| 巩义市| 镇赉县| 鹤岗市| 米林县| 社旗县| 崇明县| 蓝田县| 博罗县| 阿尔山市| 马边| 石台县| 化隆| 巢湖市| 平泉县| 常宁市| 通州区| 双江| 壶关县| 时尚| 尉犁县| 张家川|