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 分钟前
『 QT 』QT信号机制深度解析
开发语言·qt
清风wxy6 分钟前
C语言基础数组作业(冒泡算法)
c语言·开发语言·数据结构·c++·windows·算法
凤山老林8 分钟前
SpringBoot 启动时执行某些操作的 8 种方式
java·开发语言·spring boot·后端
仲星(._.)8 分钟前
C语言:自定义类型
c语言·开发语言
从零开始的ops生活11 分钟前
【Day 77】Linux-iptables防火墙
开发语言·php
Jyywww12121 分钟前
uniapp uni.chooseImage+uni.uploadFile使用方法与详解
开发语言·javascript·uni-app
墨尘笔尖25 分钟前
Qt浮动(堆叠)窗口实现详解
开发语言·qt
future141233 分钟前
C++ 学习日记
开发语言·c++·学习
froginwe1139 分钟前
jEasyUI 创建分割按钮
开发语言
努力搬砖的咸鱼1 小时前
Node.js 和 Java 项目怎么写 Dockerfile
java·开发语言·docker·云原生·容器·node.js