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;
}
相关推荐
不知名的老吴5 分钟前
浅谈:编程语言中的那些「锁」事(二)
java·开发语言
Darkwanderor25 分钟前
Linux进程优先级操作
linux·运维·c语言·c++
智者知已应修善业36 分钟前
【P12159蓝桥杯数组翻转】2025-4-24
c语言·c++·经验分享·笔记·算法·蓝桥杯
SuperByteMaster1 小时前
keil link misc controls
c语言
蜗牛~turbo1 小时前
金蝶云星空的网络控制设置
开发语言·c#·金蝶·erp·云星空·k3 cloud
Reload.1 小时前
GJ航司,验证码网易易盾 JS逆向 纯算轨迹
开发语言·前端·javascript
人道领域1 小时前
【LeetCode刷题日记】贪心算法理论与实战:455.分发饼干最优解
java·开发语言·数据结构·算法·leetcode·贪心算法
xin_yao_xin2 小时前
Conda 环境的 CUDA PATH 配置指南
开发语言·python·conda·cuda
he___H2 小时前
基于LCEL的联想
开发语言·python·langchain