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;
}
相关推荐
YUFENGSHI.LJ4 分钟前
Flutter 高性能 Tab 导航:懒加载与状态保持的最佳实践
开发语言·flutter·1024程序员节
wudl55664 分钟前
JDK 21 API增强详解
java·开发语言·windows
β添砖java5 分钟前
JS基础Day01
开发语言·javascript·ecmascript
学习编程的Kitty10 分钟前
JavaEE初阶——多线程(3)线程安全
java·开发语言·jvm
Skrrapper12 分钟前
【C++】C++ 中的 map
开发语言·c++
喵了meme15 分钟前
Linux学习日记6:文件IO与标准IO
linux·c语言·学习
杨福瑞1 小时前
数据结构:顺序表讲解(总)
c语言·数据结构
艺杯羹1 小时前
解决 Word四大烦:消标记、去波浪线、关首字母大写、禁中文引号
word·文档·1024程序员节·word技巧
寄思~1 小时前
python批量读取word表格写入excel固定位置
开发语言·python·excel
workflower2 小时前
微软PM的来历
java·开发语言·算法·microsoft·django·结对编程