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

📄 2072.cpp

📁 这是哈尔滨工业大学acmOJ的源代码
💻 CPP
字号:
/*  This Code is Submitted by wywcgs for Problem 2072 on 2005-10-01 at 10:46:23 */ 
#include <stdio.h>
#include <string.h>

int main()
{
	int screen[10][10], row, col;
	int i, j, t;
	char order[16];
	
	while(1) {
		scanf("%s", order);
		if(!strcmp(order, "ENDOFINPUT")) {
			return 0;
		} else {
			scanf("%d %d", &row, &col);
			for(i = 0; i < row; i++) {
				for(j = 0; j < col; j++) {
					scanf("%1d", &screen[i][j]);
				}
			}
			for(i = 0; i < row-1; i++) {
				for(j = 0; j < col-1; j++) {
					t = (screen[i][j] + screen[i+1][j] + screen[i][j+1] + screen[i+1][j+1]) / 4;
					printf("%d", t);
				}
				putchar('\n');
			}
			scanf("%s", order);
		}
	}
	
	return 0;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -