首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

新手求教.怎么将一篇文章中的英文单词,存放在一个数组中

2012-02-12 
新手求教.如何将一篇文章中的英文单词,存放在一个数组中?比如一篇文章:In the Orient young bulls are tes

新手求教.如何将一篇文章中的英文单词,存放在一个数组中?
比如一篇文章:In the Orient young bulls are tested for the fight arena in a certain manner. Each is brought to the ring and allowed to attack a picador who pricks them with a lance. The bravery of each bull is then rated with care according to the number of times he demonstrates his willingness to charge in spite of the sting of the blade. Henceforth will I recognize that each day I am tested by life in like manner. If I persist, if I continue to try, if I continue to charge forward, I will succeed.
如何将上面这篇文章中的单词取出来,存放在一个数组中?唉,基础太差。

[解决办法]
楼主是不是有点不厚道阿 2011的帖子不要拖到2012结嘛

C/C++ code
#include <iostream> #include <fstream> #include <string.h>using namespace std; char str[][50] = {"hello this is a c programe!n", "i know this difference n", "and mocive"}; int main(){    ofstream outfile ("data.txt");    for(int k = 0; k < 3; k++)         for(int i=0;i< strlen(str[k]);i++)             outfile.put(str[k][i]);    outfile.close();    return 0;} 

热点排行