wikioi 1276 图标的缩放
来源:互联网 发布:gh0st源码 编辑:程序博客网 时间:2024/04/29 11:23
You have been asked to take a small icon that appears on the screen of a smart telephone and scale it up so it looks bigger on a regular computer screen.
你被要求把手机上的小图标变成电脑上的大的。
The icon will be encoded as characters (x and *) in a 3 × 3 grid as follows:
小图标是:
*x*
xx
* *
Write a program that accepts a positive integer scaling factor and outputs the scaled icon. A scaling factor of k means that each character is replaced by a k × k grid consisting only of that character.
写一个程序把它每一个字符都变成k*k的
The input will be a positive integer k such that k < 25.
输入会是一个正整数k,k<25。
The output will be 3k lines, which represent each individual line scaled by a factor of k and repeated k times. A line is scaled by a factor of k by replacing each character in the line with k copies of the character.
输出会是3k行,详见样例。
3
***xxx***
***xxx***
***xxx***
xxxxxx
xxxxxx
xxxxxx
*** ***
*** ***
*** ***
按照题目要求的缩进
#include<cstdio>#include<cstdlib>int main(){ int k; scanf("%d",&k); for(int j=0;j<k;j++) { for(int i=0;i<k;i++) printf("*"); for(int i=0;i<k;i++) printf("x"); for(int i=0;i<k;i++) printf("*"); printf("\n"); } for(int i=0;i<k;i++) { for(int m=0;m<k;m++) printf(" "); for(int j=0;j<k;j++) printf("xx"); printf("\n"); } for(int i=0;i<k;i++) { for(int j=0;j<k;j++) printf("*"); printf(" "); for(int p=0;p<k-2;p++) printf(" "); for(int m=0;m<k;m++) printf("*"); printf("\n"); } return 0;}
#include<cstdio>#include<cstdlib>char image[3][4]={"*x*"," xx","* *"};int main(){ int k; scanf("%d",&k); for(int i=0;i<3*k;i++)//3k*3k是宽*长,放大之前是3*3 { for(int j=0;j<3*k;j++) { printf("%c",image[i/k][j/k]); } printf("\n"); } return 0;}
- wikioi 1276 图标的缩放
- 1276 图标缩放
- Font Awesome可缩放的矢量图标
- wikioi 数的划分
- wikioi 逃跑的拉尔夫
- WikiOI 1075 明明的随机数
- Wikioi P1026 逃跑的拉尔夫
- wikioi p1075 明明的随机数
- wikioi p1011 数的计算
- wikioi p1039 数的划分
- wikioi-1039-数的划分
- 【wikioi】1011 数的计算
- 【wikioi】1026 逃跑的拉尔夫
- wikioi 1001 舒适的路线
- wikioi 1026 逃跑的拉尔夫
- wikioi 1039 数的划分
- Wikioi 1261 龙王的礼物
- wikioi 两圆的交
- EhCache缓存学习
- 三十二、C++内存布局,对象大小计算、虚函数虚继承对类内存模型的影响
- System.map 的作用
- DG搭建物理备库
- 适配器(Adapter)
- wikioi 1276 图标的缩放
- UNIX/LINUX 平台可执行文件加载过程
- Java中守护线程的总结
- 如何编写Linux设备驱动程序
- 几个重要的Linux内核文件
- [如何读书]--记最近读书感觉效率不高的情况
- 【2014最新】iOS App 提交上架store 详细流程
- 理解 Linux 配置文件
- POJ 3122