Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
贴码#include<iostream> #include<cstdio> using namespace std; int main() { int groupNum; while(cin>>groupNum) { double initX, initY; double preX, preY; double x,y; for(int i=0; i<groupNum; i++) { cin>>x>>y; if(i==0) { initX=x; initY=y; preX=x; preY=y; cout<<groupNum; } else { printf(" %0.6f %0.6f", preX+(x-preX)/2.0, preY+(y-preY)/2.0); preX=x; preY=y; } } printf(" %0.6f %0.6f\n",initX+(x-initX)/2.0, initY+(y-initY)/2.0); } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator