需要Spellout日期的逻辑(下面附有文件 [英] Need logic for the Spellout Dates ( below attached the file

查看:74
本文介绍了需要Spellout日期的逻辑(下面附有文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目标:在此作业中,您需要主要演示文件操作,循环,字符串操作和用户定义的函数(可选)。



描述



您将开发一个C ++程序来拼出文件中给出的数字。假设您有文本文件显示为



5/3/2014

12-4-2011

01-19-200

1/1/2011

03/03/1900

...

...



输入文件每行有一个数据。请注意,日期的月,日和年可以用'/'或' - '分隔。对于上述文件,您的程序应生成



2014年5月3日

2011年12月4日

1月19,200

2011年1月1日

1900年3月3日

...

...



完成作业时,写一个函数需要一个字符串,这是一个来自文件的日期,并返回一个字符串,它是拼写出的数字,即原型似乎是



字符串拼写(字符串a);

Objective: In this assignment, you need to demonstrate mainly file operations, loops, string operations, and user defined functions (optional).

Description

You will develop a C++ program to spell out numbers given in a file. Assume that you have text file appears as

5/3/2014
12-4-2011
01-19-200
1/1/2011
03/03/1900
...
...

Input file has one data at each line. Notice that month, day, and year of date can be seperated by '/' or '-'. For the above file, your program should generate

May 3rd, 2014
December 4th, 2011
January 19th, 200
January 1st, 2011
March 3rd, 1900
...
...

While completing your assignment, write a function takes a string, which is a date from the file, and returns a string, which is spelling out of number, i.e., the prototype seems like

string Spell(string a);

推荐答案

我刚回答:您将开发一个C ++程序来拼出来文件中给出的数字。假设您有文本文件显示为5/3/2014 12-4-2011 01-19-200 1/1/2011 03/03/1900 ...... [ ^ ]。



-SA


这篇关于需要Spellout日期的逻辑(下面附有文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆