Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

看懂题意就会做了,贡献c++代码一份

Posted by s1270758234 at 2012-08-03 15:11:13 on Problem 1607
#include<iostream>
#include<iomanip>
using namespace std;
int main()
{
	int n;	
	cout<<"Cards  Overhang"<<endl;
	while(cin>>n)
		{ 
			int i;
			double sum=0.0;
			for( i=1;i<n+1;i++)
			{
				sum+=1.0/(2*i);
			}
		
			cout<<setiosflags(ios::right)<<setw(5)<<n;
			cout<<setiosflags(ios::fixed)<<setw(10)<<setprecision(3)<<sum<<endl;
	}
	return 0;
}

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator