64,654
社区成员
发帖
与我相关
我的任务
分享
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main(void)
{
ifstream file_in;
file_in.open("abc.txt");
string sLine;
int n=0;
while(getline(file_in,sLine))
{
cout<<n++<<" ";
if(sLine == " ")
cout<<"空行";
cout<<sLine<<endl;
}
file_in.close();
return 0;
}
When on board H.M.S. Beagle, as naturalist, I was much struck with certain
facts in the distribution of the organic beings inhabiting South America,
and in the geological relations of the present to the past inhabitants of
that continent. These facts, as will be seen in the latter chapters of
this volume, seemed to throw some light on the origin of species--that
mystery of mysteries, as it has been called by one of our greatest
philosophers. On my return home, it occurred to me, in 1837, that
something might perhaps be made out on this question by patiently
accumulating and reflecting on all sorts of facts which could possibly have
any bearing on it. After five years' work I allowed myself to speculate on
the subject, and drew up some short notes; these I enlarged in 1844 into a
sketch of the conclusions, which then seemed to me probable: from that
period to the present day I have steadily pursued the same object. I hope
that I may be excused for entering on these personal details, as I give
them to show that I have not been hasty in coming to a decision.
My work is now (1859) nearly finished; but as it will take me many more
years to complete it, and as my health is far from strong, I have been
urged to publish this abstract. I have more especially been induced to do
this, as Mr. Wallace, who is now studying the natural history of the Malay
Archipelago, has arrived at almost exactly the same general conclusions
that I have on the origin of species. In 1858 he sent me a memoir on this
subject, with a request that I would forward it to Sir Charles Lyell, who
sent it to the Linnean Society, and it is published in the third volume of
the Journal of that Society. Sir C. Lyell and Dr. Hooker, who both knew of
my work--the latter having read my sketch of 1844--honoured me by thinking
it advisable to publish, with Mr. Wallace's excellent memoir, some brief
extracts from my manuscripts.
This abstract, which I now publish, must necessarily be imperfect. I
cannot here give references and authorities for my several statements; and
I must trust to the reader reposing some confidence in my accuracy. No
doubt errors may have crept in, though I hope I have always been cautious
in trusting to good authorities alone. I can here give only the general
conclusions at which I have arrived, with a few facts in illustration, but
which, I hope, in most cases will suffice. No one can feel more sensible
than I do of the necessity of hereafter publishing in detail all the facts,
with references, on which my conclusions have been grounded; and I hope in
a future work to do this. For I am well aware that scarcely a single point
is discussed in this volume on which facts cannot be adduced, often
apparently leading to conclusions directly opposite to those at which I
have arrived. A fair result can be obtained only by fully stating and
balancing the facts and arguments on both sides of each question; and this
is here impossible.