字母图形练习
来源:互联网 发布:外国人的审美 知乎 编辑:程序博客网 时间:2024/06/01 09:28
这个练习昨天就在做了,但是没有成功,因为要用大量的for循环,用了两层以上的循环我就开始晕。然后我想既然要那样输出,很自然想到用二维数组结果我也没有实现。于是我就去上网看了别人的代码,别人太会找规律了,A出现的地方左右递减就可以了o(╥﹏╥)o。
要多找规律。
下面是代码
#include <stdio.h>#include <stdlib.h>#include <math.h>/* run this program using the console pauser or add your own getch, system("pause") or input loop */int main() { int w='A'; int n,m; scanf("%d %d",&n,&m); int i,j; for(i=0;i<n;i++) { for(j=0;j<m;j++) { printf("%c",w+abs(i-j)); } printf("\n"); } return 0;}
阅读全文
0 0
- 基础练习 字母图形
- 基础练习 字母图形
- 基础练习 字母图形
- 基础练习 字母图形
- 基础练习 字母图形
- 基础练习 字母图形
- 基础练习 字母图形
- 基础练习 字母图形
- 基础练习 字母图形
- 基础练习 字母图形
- 基础练习-字母图形
- 基础练习 字母图形
- 基础练习 字母图形
- 基础练习 字母图形
- 基础练习 字母图形
- 基础练习 字母图形
- 基础练习 字母图形
- 基础练习 字母图形
- PHP 类与对象(重载)
- Oracle Incident Response and Forensics.pdf 2017 英文原版 免费下载
- 二叉树的基本操作
- Codeforces Round #451 (Div. 2) A-B
- C语言(^)位异或运算符运算符 交换两个数位置
- 字母图形练习
- jzoj1935 [2011集训队出题] 单选错位 概率水题
- Linux系统的安装
- shiro的session和servlet的session的区别
- JDBC报错:Cannot find class: com.mysql.jdbc.Driver
- 周总结(一)
- 独家 | 国内首个 AI 题库上线
- scala 基础知识点
- bzoj2734 [HNOI2012]集合选数(状压DP)