zoukankan      html  css  js  c++  java
  • POJ 1607

     1 #include<iostream>
     2 #include<iomanip>
     3 using namespace std;
     4 
     5 int main()
     6 {
     7     //freopen("acm.acm","r",stdin);
     8     double sum;
     9     double temp;
    10     int n_temp;
    11     int n;
    12     cout<<"Cards  Overhang "<<endl;
    13     while(cin>>n)
    14     {
    15         n_temp = n;
    16         sum = 0;
    17         temp = 2;
    18         while(n --)
    19         {
    20             sum += 1.0/temp;
    21             temp += 2;
    22         }
    23         cout<<setw(5)<<n_temp<<setw(10)<<setiosflags(ios::fixed)<<setprecision(3)<<sum<<endl;
    24     }
    25 }

    关注我的公众号,当然,如果你对Java, Scala, Python等技术经验,以及编程日记,感兴趣的话。 

    技术网站地址: vmfor.com

  • 相关阅读:
    405
    406
    4-1
    3-11
    3-10
    3-9
    3-8
    3-7
    3-5
    3-4
  • 原文地址:https://www.cnblogs.com/gavinsp/p/4566458.html
Copyright © 2011-2022 走看看