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;
}
相关推荐
yuuki233233几秒前
【数据结构】常见时间复杂度以及空间复杂度
c语言·数据结构·后端·算法
越努力越幸运5081 分钟前
JavaScript进阶篇垃圾回收、闭包、函数提升、剩余参数、展开运算符、对象解构
开发语言·javascript
czhc11400756631 分钟前
C# 1116 流程控制 常量
开发语言·c#
byte轻骑兵30 分钟前
【安全函数】C语言安全字符串函数详解:告别缓冲区溢出的噩梦
c语言·安全·面试
程序定小飞1 小时前
基于springboot的汽车资讯网站开发与实现
java·开发语言·spring boot·后端·spring
大米粥哥哥1 小时前
Qt 使用QAMQP连接RabbitMQ
开发语言·qt·rabbitmq·qamqp
python_DONG1 小时前
word中怎么查看插入的图片占用内存大小来压缩word文件整体大小
word
weixin_438338511 小时前
word表格操作疑难杂症处理
word
yivifu1 小时前
精益求精,支持处理嵌套表格的Word表格转HTML表格
开发语言·c#·word
沐知全栈开发1 小时前
PHP MySQL WHERE 子句详解
开发语言