uva 10894 - Save Hridoy
#include <iostream>
#include <string>
#include <cstring>
#include <cmath>
using namespace std; int main(){
//initialize for positive number
char h[][];
strcpy(h[], "*****..***..*...*.*****...*...*.*****.*****.***...*****.*...*");
strcpy(h[], "*.....*...*.*...*.*.......*...*.*...*...*...*..*..*...*..*.*.");
strcpy(h[], "*****.*****.*...*.***.....*****.*****...*...*...*.*...*...*..");
strcpy(h[], "....*.*...*..*.*..*.......*...*.*.*.....*...*..*..*...*...*..");
strcpy(h[], "*****.*...*...*...*****...*...*.*..**.*****.***...*****...*.."); //initialize for negative number
char v[][];
strcpy(v[], "*****");
strcpy(v[], "*....");
strcpy(v[], "*****");
strcpy(v[], "....*");
strcpy(v[], "*****");
strcpy(v[], ".....");
strcpy(v[], ".***.");
strcpy(v[], "*...*");
strcpy(v[], "*****");
strcpy(v[], "*...*");
strcpy(v[],"*...*");
strcpy(v[],".....");
strcpy(v[],"*...*");
strcpy(v[],"*...*");
strcpy(v[],"*...*");
strcpy(v[],".*.*.");
strcpy(v[],"..*..");
strcpy(v[],".....");
strcpy(v[],"*****");
strcpy(v[],"*....");
strcpy(v[],"***..");
strcpy(v[],"*....");
strcpy(v[],"*****");
strcpy(v[],".....");
strcpy(v[],".....");
strcpy(v[],".....");
strcpy(v[],"*...*");
strcpy(v[],"*...*");
strcpy(v[],"*****");
strcpy(v[],"*...*");
strcpy(v[],"*...*");
strcpy(v[],".....");
strcpy(v[],"*****");
strcpy(v[],"*...*");
strcpy(v[],"*****");
strcpy(v[],"*.*..");
strcpy(v[],"*..**");
strcpy(v[],".....");
strcpy(v[],"*****");
strcpy(v[],"..*..");
strcpy(v[],"..*..");
strcpy(v[],"..*..");
strcpy(v[],"*****");
strcpy(v[],".....");
strcpy(v[],"***..");
strcpy(v[],"*..*.");
strcpy(v[],"*...*");
strcpy(v[],"*..*.");
strcpy(v[],"***..");
strcpy(v[],".....");
strcpy(v[],"*****");
strcpy(v[],"*...*");
strcpy(v[],"*...*");
strcpy(v[],"*...*");
strcpy(v[],"*****");
strcpy(v[],".....");
strcpy(v[],"*...*");
strcpy(v[],".*.*.");
strcpy(v[],"..*..");
strcpy(v[],"..*..");
strcpy(v[],"..*.."); bool flag = false, pos;
int n, m, i, j, k;
while (cin >> n){
if (n == ) break;
if (flag)
cout << endl << endl; flag = true;
pos = true;
if (n < ){
pos = false;
n = abs(n);
}
//output for positive number
if (pos){
for (i = ; i < ; ++i){
m = ;
while (m < n){
for (j = ; h[i][j]; ++j){
k = ;
while (k < n){
cout << h[i][j];
++k;
}
}
++m;
cout << endl;
}
}
}
else{
for (i = ; i < ; ++i){
m = ;
while (m < n){
for (j = ; v[i][j]; ++j){
k = ;
while (k < n){
cout << v[i][j];
++k;
}
}
++m;
cout << endl;
}
}
}
}
cout << endl << endl;
return ;
}
//画图题,直接打表
#include <stdio.h> char h[][] =
{
"*****..***..**.*******.*****.*****.********.**",
"*..**.**.*.**.****..*..**..*.*.",
"*****.*****.**.***..*****.********.***..",
".*.**..*.*..*.**.*.*..**..*..***..",
"*****.**********.*..**.*****.*********.."
}; char v[][] =
{
"*****",
"*.",
"*****",
".*",
"*****",
"..",
".***.",
"**",
"*****",
"**",
"**",
"..",
"**",
"**",
"**",
".*.*.",
"..*..",
"..",
"*****",
"*.",
"***..",
"*.",
"*****",
"..",
"..",
"..",
"**",
"**",
"*****",
"**",
"**",
"..",
"*****",
"**",
"*****",
"*.*..",
"*..**",
"..",
"*****",
"..*..",
"..*..",
"..*..",
"*****",
"..",
"***..",
"*..*.",
"**",
"*..*.",
"***..",
"..",
"*****",
"**",
"**",
"**",
"*****",
"..",
"**",
".*.*.",
"..*..",
"..*..",
"..*.."
}; void draw(int n)
{
if(n < )
{
n = -n;
for(int i = ; i < * n; i++)
{
for(int j = ; j < * n; j++)
{
printf("%c", v[i / n][j / n]);
}
printf("\n");
}
}
else
{
for(int i = ; i < * n; i++)
{
for(int j = ; j < * n; j++)
{
printf("%c", h[i / n][j / n]);
}
printf("\n");
}
}
printf("\n\n");
} int main()
{
int n;
while(scanf("%d", &n), n) draw(n);
return ;
}
uva 10894 - Save Hridoy的更多相关文章
- UVA - 11986 Save from Radiation
Description J Save from Radiation Most of you are aware of Nuclear Power Plant Explosion at Fukushim ...
- UVa 12403 - Save Setu
题目:有两种操作:1.当前数值添加.2.输出当前数值. 分析:简单题.模拟就可以. 说明:A+B. #include <iostream> #include <cstdlib> ...
- UVA 1291 十四 Dance Dance Revolution
Dance Dance Revolution Time Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld & %llu Su ...
- UVA 322 ships (POJ 1138)
题目地址: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem ...
- UVA它11292 - Dragon of Loowater
Problem C: The Dragon of Loowater Once upon a time, in the Kingdom of Loowater, a minor nuisance tur ...
- UVA 257 - Palinwords(弦HASH)
UVA 257 - Palinwords 题目链接 题意:输出一个文本里面的palinword,palinword的定义为.包括两个不同的回文子串,而且要求回文子串不能互相包括 思路:对于每一个单词推 ...
- UVA 11292 Dragon of Loowater(简单贪心)
Problem C: The Dragon of Loowater Once upon a time, in the Kingdom of Loowater, a minor nuisance tur ...
- UVA 1341 - Different Digits(数论)
UVA 1341 - Different Digits 题目链接 题意:给定一个正整数n.求一个kn使得kn上用的数字最少.假设同样,则输出值最小的 思路: 首先利用鸽笼原理证明最多须要2个数字去组成 ...
- Risk UVA - 12264 拆点法+最大流+二分 最少流量的节点流量尽量多。
/** 题目:Risk UVA - 12264 链接:https://vjudge.net/problem/UVA-12264 题意:给n个点的无权无向图(n<=100),每个点有一个非负数ai ...
随机推荐
- java中值得类型转化
在Java编程过程,基本数据类型(boolean除外)的可以相互转化.其中: (1)低容量小的类型自动转换为容量大的数据类型:数据类型按容量大小排序为: byte,short,char->int ...
- 【原创】CLEVO P157SM外接鼠标键盘失灵解决:更换硅脂(附带最新跑分数据)
作者批注:本文允许转载,并且希望给搜索未来人类.蓝天.CLEVO.更换硅脂或者任何有关关键字的朋友提供帮助. 原文地址:http://www.cnblogs.com/c4isr/p/3514140.h ...
- AE-分享<学习后,制作的视频实例>小视频-与大家交流!
- (摘)Chart属性设置
Chart ChartBorder 图表区域的边框设置 ChartFill 图表区域的背景填充 Legend 图表的注释标签显示设置项目,一组数据对应一种颜色的注释 IsHStack 当有多个显示项的 ...
- mongodb工具
可视化管理工具 http://www.mongovue.com/ mongodb use case http://www.mongodb.org/about/applications/ mongodb ...
- Xamarin.Forms-VS安装调试错误
编译android项目报错检查android sdk 是否安装成功后发现报错如下图: 点击->工具->android sdk manager 报错 错误原因没有找到 android ...
- SqlMapConfig.xml全局配置文件解析
一:SqlMapConfig.xml配置文件的内容和配置顺序如下 properties(属性) settings(全局配置参数) typeAiases(类型别名) typeHandlers(类型处理器 ...
- xcode安装
Xcode5.1默认不支持iOS5版本的模拟器开发调试,在OS X Mavericks(10.9.x)下默认只能支持iOS6.1及以上版本的模拟器,在OS X Mountain Lion(10.8.x ...
- HDOJ 1395 2^x mod n = 1
Problem Description Give a number n, find the minimum x(x>0) that satisfies 2^x mod n = 1. Input ...
- bzoj3767 A+B Problem加强版
Description Input 输入A,B Output 输出A+B. Sample Input 1 1 Sample Output 2 HINT 对于100%的数据,保证 |A| , | ...