主观

请写出myText1. txt文本文件中的内容

#include ﹤iostream﹥

#include ﹤string﹥

using namespace std;

#include ﹤fstream﹥

void main( )

{

ofstream myFile1;

myFile1. open("myText1. txt");

cout﹤﹤"Enter the data in Chinese format(e. g. , 2008, May 25): "﹤ endl;  string Date("2008, January 1");

string Year=Date. substr(0,4);

int k=Date. find( ",");

int i= Date. find(" ");

string Month= Date. substr(k+1, i-k-1);

tring Day = Date. substr(i+1, 2);

string NewDate=Day +" "+Month+" "+Year;

myFile1﹤﹤"original date: "﹤﹤ Date ﹤﹤ endl;

myFile1﹤﹤"Converted date: "﹤﹤NewDate ﹤﹤ endl;

myFile1. close( );

}

参考答案
您可能感兴趣的试题
¥

订单号:

遇到问题请联系在线客服

订单号:

遇到问题请联系在线客服