The Little Prince-11/28

The Little Prince-11/28

  The Little Prince-11/28

  Today I find some beautiful words from the book.

  You know -- one loves the sunset, when one is so sad ...

  If someone loves a flower, of which just one single blossom grows in all the millions and millions of stars, it is enough to make him happy just to look at the stars. He can say to himself, "Somewhere, my flower is there ..." But if the sheep eats the flower, in one moment all his stars will be darkened ... And you think that is not important!

  For she did not want him to see her crying. She was such a proud flower ...

  His flower had told him that she was only one of her kind in all universe. And here were five thousand of them, all alike, in one single garden!

  I thought that I was rich, with a flower that was unique in all the world; and all I had was a common rose. A common rose ...

  To me, you are still nothing more than a little boy who is just like a hundred thousand other little boys. And I have no need of you. And you, on your part, have no need of me. To you, I am nothing more than a fox like a hundred thousand other foxes. But if you tame me, then we shall need each other. To me, you will be unique in all the world. To you, I shall be unique in all the world.

  It has done me good, because of the color of the wheat fields. Go and look again at the roses. You will understand now that yours is unique in all the world.

  It is the time you have wasted for your rose that makes your rose so important.

 

posted @ 2017-11-28 23:20 Edge_of_Eternity 阅读( ...) 评论( ...) 编辑 收藏
#include<iostream> #include<fstream> #include<string> #include <algorithm> using namespace std; #define MAXSIZE 10000 #define KEYSIZE 10 #define OK 0 #define ERROR -1 typedef string KeyType; typedef struct { KeyType key; int count; int index; }ElemType; typedef struct { ElemType *R; int length; }SSTable; KeyType key[KEYSIZE] = {"little","prince","sheep","flowers","believe","stars","one","my","he","the"}; int InitSSTable(SSTable &ST) { /*-----------代码开始--------------*/ /*-----------代码结束--------------*/ return OK; } int InsertSSTable(SSTable &ST,KeyType key,int index) { ST.length++; /*-----------代码开始--------------*/ /*-----------代码结束--------------*/ ST.R[ST.length].index = index; return OK; } string SplitWord(string str) { int begin, end; for(begin=0;begin<str.length();begin++) { if(str[begin]>='a' && str[begin]<='z') break; } for(end=str.length()-1;end>=0;end--) { if(str[end]>='a' && str[end]<='z') break; } if(begin<=end) return str.substr(begin,end-begin+1); else return ""; } char op(char c) { if(c>='A' && c<='Z') c = c+32; return c; } int ProcessIn(KeyType *test,int &len,ifstream &in) { int i = 0; string temp; while(!in.eof()) { in>>temp; transform(temp.begin(), temp.end(), temp.begin(), op); test[i] = SplitWord(temp); i++; } len = i; return OK; } int SearchBin(SSTable ST,KeyType key) { /*-----------代码开始--------------*/ /*-----------代码结束--------------*/ return 0; } void Show(SSTable ST) { for(int i=1;i<=KEYSIZE;i++) cout<<ST.R[i].key<<":"<<ST.R[i].count<<endl; } bool CmpKey(ElemType x,ElemType y) { return x.key < y.key; } bool CmpIndex(ElemType x,ElemType y) { return x.index < y.index; } int main() { ifstream in("testData/小王子.txt"); SSTable ST; KeyType test[MAXSIZE]; int len; ProcessIn(test,len,in); InitSSTable(ST); for(int i=0;i<KEYSIZE;i++) InsertSSTable(ST,key[i],i); sort(ST.R+1,ST.R+1+KEYSIZE,CmpKey); //统计关键词列表中单词的词频 /*-----------代码开始--------------*/ /*-----------代码结束--------------*/ sort(ST.R+1,ST.R+1+KEYSIZE,CmpIndex); Show(ST); in.close(); return OK; }
06-02
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值