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;
}
相关推荐
何以解忧,唯有..3 小时前
Python 异常处理完全指南:从基础到高级实践
开发语言·前端·python
gugucoding3 小时前
57. 【Java】日志框架:SLF4J与Logback
java·开发语言·logback
此生决int3 小时前
深入理解C++系列(15)——AVL树
开发语言·c++
筱璦3 小时前
PHP+ VUE3机构级股票分仓管理交易系统源码可出
开发语言·php·vue3·量化·股票分仓
爱奥尼欧3 小时前
10.C++ string 实现详解
java·开发语言·c++
DS随心转APP3 小时前
实测 AI 导出鸭实操效果,依托 AI 直接生成 word 功能横向比对五类导出办法,梳理办公文档转换最优路径
人工智能·ai·word·deepseek·ai导出鸭
骇客野人3 小时前
Java分布式任务调度方案(完整落地指南)
java·开发语言·分布式
JacksonMx3 小时前
Spring @Async 坑点 + 改造方案
java·开发语言
你怎么知道我是队长4 小时前
IPv6 地址完全解析:从结构到实战
开发语言·php
小雪崩4 小时前
嵌入式学习 day30:minilog
linux·c语言·学习