标签:include ace lib while namespace sum return 1.0 hang
题目链接:http://vjudge.net/problem/HDU-1330
这题看起来给人晕乎乎的感觉,实际上废话连篇。不建议写。
1 #include <cstdio> 2 #include <cstring> 3 #include <cmath> 4 #include <iostream> 5 #include <algorithm> 6 #include <string> 7 #include <cstdlib> 8 9 using namespace std; 10 11 int main() 12 { 13 int n; 14 printf("# Cards Overhang\n"); 15 while(~scanf("%d",&n)) 16 { 17 double sum=0; 18 for(int j=1; j<=n; j++) 19 sum+=1.0/(2*j); 20 printf("%5d%10.3lf\n",n,sum); 21 } 22 return 0; 23 }
标签:include ace lib while namespace sum return 1.0 hang
原文地址:http://www.cnblogs.com/ACDoge/p/6135803.html