列表

详情


NC200014. Lady Layton with Age

描述

Lady Layton come to your house.

Now she want to guess your age.

There are some information she knows:

Your family have 5 members :  and you.

The  is 4 years younger than you.

The  is 3 years younger than .

The  is 4 years younger than .

The  is 3 years older than .

If  is x years old, then how old are you?

输入描述


The first line contains one integer T(1<=T<=10)— the number of test cases.

The only line of each test case contains one integers x(1<=x<=100) — the age of .

输出描述

For each test case print one integer in one line — the age of you.

示例1

输入:

1
19

输出:

19

原站题解

上次编辑到这里,代码来自缓存 点击恢复默认模板

C++11(clang++ 3.9) 解法, 执行用时: 3ms, 内存消耗: 376K, 提交时间: 2019-12-07 14:54:48

#include<stdio.h>
int main()
{
	int t,x,m;
	scanf("%d",&t);
	while(t--){
		scanf("%d",&x);
		printf("%d\n",x);
	}
 } 

Python(2.7.3) 解法, 执行用时: 18ms, 内存消耗: 2920K, 提交时间: 2019-12-07 13:40:11

t = int(raw_input())

for i in range(t):
    x = raw_input()
    print(x)

pypy3(pypy3.6.1) 解法, 执行用时: 50ms, 内存消耗: 18520K, 提交时间: 2019-12-07 15:18:00

n = int(input())
for i in range(n) :
    print(input())

Python3(3.5.2) 解法, 执行用时: 24ms, 内存消耗: 3424K, 提交时间: 2019-12-07 13:16:36

for T in range(int(input())):
    print(input())

上一题