A1031
2024-10-07 07:39:57
画图,用二维数组作为画布
#include<cstdio>
#include<string.h>
int main(){
char c[],u[][];
scanf("%s",&c);
memset(u,' ',sizeof(u));
int n=strlen(c)+;
int n1=n/,n2=n/+n%,index=;
for(int i=;i<n1;i++) u[i][]=c[index++];
for(int i=;i<=n2-;i++)u[n1-][i]=c[index++];
for(int i=n1-;i>=;i--)u[i][n2-]=c[index++];
for(int i=;i<n1;i++){
for(int j=;j<n2;j++) printf("%c",u[i][j]);
printf("\n");
}
return ;
}
最新文章
- SQL Server编程(01)流程控制
- 在Hadoop平台跑python脚本
- C#编程总结 dynamic(转)
- Mongodb 笔记07 分片、配置分片、选择片键、分片管理
- jquery validate 小demo
- IIS 7.5站点配置
- jQuery Tags Input Plugin 插件的使用
- 最受欢迎telnet
- jQuery 页面加载事件
- 《C程序设计语言》读书笔记----习题1-21
- About the diffrence of wait timed_wait and block in java
- yum安装jdk
- CentOS7 安装配置 MySQL 5.7
- &#39;ascii&#39; codec can&#39;t decode byte 0xe5 in position 10: ordinal not in range(128)
- 微信小程序从零开始开发步骤-引入框架WeUI
- Parsing error was found in mapping #{}. Check syntax #{property|(expression), var1=value1, var2=val错误
- 还是Go 为了伟大的未来
- 汇编 ADD指令
- 从头来之【iOS及历史版本特性介绍】
- 2018.10.20 NOIP模拟 面包(数学期望)
热门文章
- python学习笔记:(三)list(列表)常用的内置方法
- Linux centos 解决";不在 sudoers 文件中。此事将被报告";的问题
- windows,oracle,dg报错:ORA-12528,ORA-12154,ORA-10456 ,PING[ARC1]: Heartbeat failed to connect to standby &#39;orclbk&#39;. Error is 12154
- WebMvcConfigurer 与 WebMvcConfigurationSupport避坑指南
- Django框架效率问题的解决方法和总…
- Servlet 响应 响应相关与重定向 请求 获取表单数据2种方法
- Python_ONLINE_习题集_1 递归
- 第二章 Git
- 第四周Java实验总结&;学习总结
- base64 换表 解密脚本