POJ 1939 Diplomatic License G++
来源:互联网 发布:死侍 知乎 编辑:程序博客网 时间:2024/05/20 06:10
#include <iostream>#include <vector>#include <iomanip>//谢谢博友文章 using namespace std; int main(){vector<int> shu;vector<double> jg;while(1){int NUM;cin>>NUM;if(cin.eof()==1){break;}shu.push_back(NUM);double a[NUM],b[NUM];for(int i=0;i<NUM;i++){double x,y;cin>>x>>y;a[i]=x;b[i]=y;if(i>=1){jg.push_back((a[i]+a[i-1])/2);jg.push_back((b[i]+b[i-1])/2);}}jg.push_back((a[0]+a[NUM-1])/2);jg.push_back((b[0]+b[NUM-1])/2);}/*for(int j=0;j<shu.size();j++){cout<<shu[j]<<endl;}for(int j=0;j<jg.size();){cout<<jg[j]<<" "<<jg[j+1]<<" ";j++;j++;}*/int js=0;for(int i=0;i<shu.size();i++){cout<<shu[i]<<" ";cout<<setiosflags(ios::fixed)<<setprecision(6);for(int j=js;j<js+shu[i]*2;){cout<<jg[j]<<" "<<jg[j+1]<<" ";j++;j++;}cout<<endl;js=js+shu[i]*2;}return 0;}
0 0
- POJ 1939 Diplomatic License G++
- poj 1939 Diplomatic License
- zoj 1973 || poj 1939 Diplomatic License
- POJ 1939 Diplomatic License(求线段中点)
- POJ 1939 Diplomatic License(水~)
- 【POJ1939】:Diplomatic License
- 【坑】【水】poj1939 Diplomatic License
- License
- License
- license
- license
- ORACLE DATABASE 10g EXPRESS EDITION LICENSE AGREEMENT
- POJ 3094 Quicksum G++
- POJ 1552 Doubles G++
- POJ 2080 Calendar G++
- POJ 3627 Bookshelf G++
- POJ 3543 iChess G++
- POJ 3302 Subsequence G++
- 解决VS中没有ADO.NET实体数据模型
- 利用SSH 或 Teamviewer 控制远程服务器
- java 垃圾收集相关常用参数
- 判断回文字符串(给定开始位置和字符个数)
- 文章标题
- POJ 1939 Diplomatic License G++
- Spring @Autowired和@Qualifier注解
- 关于springmvc返回到前台报406错误与404错误的解决
- CoordinatorLayout显示隐藏ToolBar
- Mysql笔记
- java基础知识,一些概念的区别总结
- 内存管理-SLAB(SLAB的基本数据结构)
- C++中的new、operator new与placement new
- HDU-1004Let the Balloon Rise