1480.cpp
来自「哈尔滨工业大学ACM 竞赛网上在线试题集锦的源代码」· C++ 代码 · 共 24 行
CPP
24 行
/* This Code is Submitted by wywcgs for Problem 1480 on 2006-01-12 at 04:48:09 */
#include <cstdio>
int main()
{
double b[2], c[2], n[2];
int i, m;
while(scanf("%d", &m) != EOF) {
scanf("%lf %lf", &b[0], &b[1]);
c[0] = b[0]; c[1] = b[1];
printf("%d", m);
for(i = 0; i < m; i++) {
if(i != m-1) scanf("%lf %lf", &n[0], &n[1]);
else n[0] = b[0], n[1] = b[1];
printf(" %.6lf %.6lf", (n[0]+c[0])/2, (n[1]+c[1])/2);
c[0] = n[0]; c[1] = n[1];
}
putchar('\n');
}
return 0;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?