求解一道简单关于输出日期的C++小题
关注:203 答案:2 手机版
解决时间 2021-01-27 22:16
- 提问者网友:心死旳很干净
- 2021-01-27 05:51
/.find("/?为什么是到u哪里;).rfind("<);
}
我知道答案是, i-k-4).substr(0:".close()?.substr(k+1; /myTextl;Date <
cout?;endl; substr() 函数返回字符串的一部分k+1是J的位置?.find("
cout <.rfind("fstream>
void main()
{
ofstream cout,i-k-4是;/< + Year; /.substr(k+1;<Converted date, ";2008;
int i = Date,1的前面)那个位置(i=)
string Month =Date;);
string NewDate = Day + "i 到“ ”(空格, 2), January 1" + Month + "
cout <:
2008;/, January 1"新改
string Day = Date;< " <
cout;
int k =Date#include <,”那个位置(k=5)
int i =Date;;
#include <k到“;);新改
string Month = Date;"
string Date(");/ /.substr(0, i-k-4); ", 4), 4););
string Year =Date:
string Date(":", January 1
1 Janu 2008
解题思路; "iostream>
#include <"<!我左减减右减减也减不出来;</
string Year = Date; <original date;
int k = Date; "
using namespace std.substr(i+1;/), "2008.txt".open("string>NewDate <endl
最佳答案
- 二级知识专家网友:el孤酒el
- 2021-01-27 07:04
substr() 参数应该是(起始位置,长度)这样的吧,应该该i-k-1
全部回答
- 1楼网友:过不去的回忆
- 2021-01-27 07:50
k = 4i = 12, i-k-1).substr(k+1;你要得到月 应该是这样string Month =Date
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!