CPTTRN2 - Character Patterns (Act 2)
来源:互联网 发布:js访问对象 编辑:程序博客网 时间:2024/06/04 23:36
Using two characters: . (dot) and * (asterisk) print a frame-like pattern.
Input
You are given t - the number of test cases and for each of the test cases two positive integers: l - the number of lines and c - the number of columns of a frame.
Output
For each of the test cases output the requested pattern (please have a look at the example). Use one line break in between successive patterns.
Example
Input:33 14 42 5Output:********..**..***************主要 是python中的if语句的使用
代码如下
t = int(input())for i in range(t): line = input() l = int(line.split(' ')[0]) c = int(line.split(' ')[1]) for j in range(l): for k in range(c): if j == 0 or j == l - 1: print('*', sep='', end='') elif k == 0 or k == c - 1: print('*', sep='', end='') else: print('.', sep='',end='') print()
0 0
- CPTTRN2 - Character Patterns (Act 2)
- CPTTRN1 - Character Patterns (Act 1)
- spoj CPTTRN3 - Character Patterns (Act 3)
- spoj CPTTRN4 - Character Patterns (Act 4)
- spoj CPTTRN5 - Character Patterns (Act 5)
- spoj CPTTRN6 - Character Patterns (Act 6)
- spoj CPTTRN7 - Character Patterns (Act 7)
- spoj 16891 Character Patterns (Act 8)
- CPTTRN2
- ACT
- Ajax Patterns 读书笔记 --2
- 初识Q-Patterns - 2
- patterns
- patterns
- patterns
- character
- Character
- Character
- win10 python 二维码生成
- poj 2586 Y2K Accounting Bug【水水】
- linux线程1(一个简单的线程程序)
- 哈希表
- 线性表--顺序存储结构
- CPTTRN2 - Character Patterns (Act 2)
- Java Web项目开发到底需要掌握哪些技术(转载)
- Spring MVC hello world example
- 盖茨:如何通过市场力量为穷人服务
- Visual C++中error spawning cl.exe错误的解决方法
- hdu1099
- Pylearn2的使用简介
- 如何阅读Java
- Unity3D笔记第七天——光源、摄像机