⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 1480.cpp

📁 这是哈尔滨工业大学acmOJ的源代码
💻 CPP
字号:
/*  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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -