画图,用二维数组作为画布

 #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 ;
}

最新文章

  1. SQL Server编程(01)流程控制
  2. 在Hadoop平台跑python脚本
  3. C#编程总结 dynamic(转)
  4. Mongodb 笔记07 分片、配置分片、选择片键、分片管理
  5. jquery validate 小demo
  6. IIS 7.5站点配置
  7. jQuery Tags Input Plugin 插件的使用
  8. 最受欢迎telnet
  9. jQuery 页面加载事件
  10. 《C程序设计语言》读书笔记----习题1-21
  11. About the diffrence of wait timed_wait and block in java
  12. yum安装jdk
  13. CentOS7 安装配置 MySQL 5.7
  14. &#39;ascii&#39; codec can&#39;t decode byte 0xe5 in position 10: ordinal not in range(128)
  15. 微信小程序从零开始开发步骤-引入框架WeUI
  16. Parsing error was found in mapping #{}. Check syntax #{property|(expression), var1=value1, var2=val错误
  17. 还是Go 为了伟大的未来
  18. 汇编 ADD指令
  19. 从头来之【iOS及历史版本特性介绍】
  20. 2018.10.20 NOIP模拟 面包(数学期望)

热门文章

  1. python学习笔记:(三)list(列表)常用的内置方法
  2. Linux centos 解决&quot;不在 sudoers 文件中。此事将被报告&quot;的问题
  3. windows,oracle,dg报错:ORA-12528,ORA-12154,ORA-10456 ,PING[ARC1]: Heartbeat failed to connect to standby &#39;orclbk&#39;. Error is 12154
  4. WebMvcConfigurer 与 WebMvcConfigurationSupport避坑指南
  5. Django框架效率问题的解决方法和总…
  6. Servlet 响应 响应相关与重定向 请求 获取表单数据2种方法
  7. Python_ONLINE_习题集_1 递归
  8. 第二章 Git
  9. 第四周Java实验总结&amp;学习总结
  10. base64 换表 解密脚本