2015年11月1日

统计n个数中的1的个数

摘要: #include#include#includeusing namespace std;int main(){ freopen("rand.txt","r",stdin); freopen("xuduoshudeyi.out","w",stdout); int n,count=0,... 阅读全文

posted @ 2015-11-01 13:08 tjtzgby 阅读(189) 评论(1) 推荐(0) 编辑

随机数生成器,完成后打开文件。

摘要: #include#include#include#includeusing namespace std;int main(){ freopen("rand.txt","w",stdout); long long a,b,n,cou;//cou:数据个数; cin>>a>>b>>c... 阅读全文

posted @ 2015-11-01 13:05 tjtzgby 阅读(168) 评论(0) 推荐(0) 编辑

如何做到一个分数序列和

摘要: #include#include#includeusing namespace std;int main(){ int n; double sum=0; cin>>n; for(int i=1;i<=n;++i) { if(i%2==0) {... 阅读全文

posted @ 2015-11-01 12:03 tjtzgby 阅读(174) 评论(0) 推荐(0) 编辑

导航