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;
}
相关推荐
我是老孙11 分钟前
windows10 php报错
开发语言·php
y1021210414 分钟前
Python训练营打卡Day42
开发语言·javascript·ecmascript
old_power17 分钟前
UCRT 和 MSVC 的区别(Windows 平台上 C/C++ 开发相关)
c语言·c++·windows
2301_8050545625 分钟前
Python训练营打卡Day46(2025.6.6)
开发语言·python
曹勖之35 分钟前
撰写脚本,通过发布/joint_states话题改变机器人在Rviz中的关节角度
开发语言·python·机器人·ros2
不惑_41 分钟前
用 PyQt5 打造一个可视化 JSON 数据解析工具
开发语言·qt·json
梓仁沐白1 小时前
【Kotlin】注解&反射&扩展
开发语言·python·kotlin
@老蝴1 小时前
C语言 — 编译和链接
c语言·开发语言
本郡主是喵2 小时前
并发编程 - go版
java·服务器·开发语言
努力学习的小廉2 小时前
我爱学算法之—— 前缀和(中)
开发语言·redis·算法