C. Word on the Paper

time limit per test

1 second

memory limit per test

256 megabytes

input

standard input

output

standard output

On an 8×88×8 grid of dots, a word consisting of lowercase Latin letters is written vertically in one column, from top to bottom. What is it?

Input

The input consists of multiple test cases. The first line of the input contains a single integer t� (1≤t≤10001≤�≤1000) --- the number of test cases.

Each test case consists of 88 lines, each containing 88 characters. Each character in the grid is either .. (representing a dot) or a lowercase Latin letter (aa--zz).

The word lies entirely in a single column and is continuous from the beginning to the ending (without gaps). See the sample input for better understanding.

Output

For each test case, output a single line containing the word made up of lowercase Latin letters (aa--zz) that is written vertically in one column from top to bottom.

Example

input

Copy

复制代码

5

........

........

........

........

...i....

........

........

........

........

.l......

.o......

.s......

.t......

........

........

........

........

........

........

........

......t.

......h.

......e.

........

........

........

........

........

.......g

.......a

.......m

.......e

a.......

a.......

a.......

a.......

a.......

a.......

a.......

a.......

output

Copy

复制代码
i
lost
the
game
aaaaaaaa

解题说明:水题,直接遍历输出字母即可。

cpp 复制代码
#include<stdio.h>

int main()
{
	int t;
	scanf("%d", &t);
	for (t; t > 0; t--)
	{
		char a[72];
		for (int i = 0; i < 72; i++)
		{
			scanf("%c", &a[i]);
		}
		for (int i = 0; i < 72; i++)
		{
			if (a[i] >= 'a' && a[i] <= 'z')
			{
				printf("%c", a[i]);
			}
		}
		printf("\n");
	}
	return 0;
}
相关推荐
源代码•宸14 分钟前
Golang语法进阶(协程池、反射)
开发语言·经验分享·后端·算法·golang·反射·协程池
Dillon Dong1 小时前
STM32嵌入式:使用 MT29F8G08ABACAWP NAND 的FLASH全面指南
c语言·stm32
basketball6161 小时前
python 的对象序列化
开发语言·python
fie88891 小时前
钢结构件制造车间生产调度实例:MATLAB实现(基于遗传算法)
开发语言·matlab·制造
沐知全栈开发1 小时前
PHP 安装指南
开发语言
Highcharts.js2 小时前
Highcharts Grid 表格/网格安装 |官方安装文档说明
开发语言·javascript·表格组件·highcharts·官方文档·安装说明·网格组件
zhongvv2 小时前
对单片机C语言指针的一些理解
c语言·数据结构·单片机·指针·汇编语言
Coder_Boy_2 小时前
基于SpringAI的在线考试系统-企业级软件研发工程应用规范实现细节
大数据·开发语言·人工智能·spring boot
lly2024063 小时前
SQL SELECT 语句详解
开发语言
superman超哥3 小时前
Rust 异步时间管理核心:Tokio 定时器实现机制深度剖析
开发语言·rust·编程语言·rust异步时间管理核心·tokio定时器实现机制·tokio定时器