摘要: #include int main() { int count = 0; int n; scanf("%d",&n); while(n>1) { if(n%2==1) n=n*3+1; else n/=2; count++; } printf("%d\n",count); ... 阅读全文
posted @ 2018-10-21 14:05 MichaelCecil 阅读(734) 评论(0) 推荐(0) 编辑
摘要: #include int main(){ int i,n; scanf("%d",&n); float sum=0.0; float a=1; float b=2; for(i=1;i<=n;i++){ sum=sum+1.0*b/a; int c=a; a=b; b=c+b; ... 阅读全文
posted @ 2018-10-21 13:38 MichaelCecil 阅读(1528) 评论(0) 推荐(0) 编辑