Codeforces Round #259 (Div. 2) 454A Little Pony and Crystal Mine(模拟)
来源:互联网 发布:android软件 编辑:程序博客网 时间:2024/05/16 11:43
学习C语言时候最简单的模拟。。
AC代码:
#include "iostream"#include "cstdio"#include "cstring"#include "algorithm"using namespace std;int main(int argc, char const *argv[]){int n;while(cin >> n) {int a = n /2, b = 1, c = 1;for(int i = 1; i <= n; ++i) {if(a >= 1) {for(int j = 1; j <= a; ++j)printf("*");for(int j = 1; j <= b; ++j)printf("D");for(int j = 1; j <= a; ++j)printf("*");printf("\n");a -= 1;b += 2;}else if(a == 0) {for(int j = 1; j <= n; ++j)printf("D");printf("\n");a -= 1;b -= 2;}else {for(int j = 1; j <= c; ++j)printf("*");for(int j = 1; j <= b; ++j)printf("D");for(int j = 1; j <= c; ++j)printf("*");printf("\n");c += 1;b -= 2;}}}return 0;}
1 0
- Codeforces Round #259 (Div. 2) 454A Little Pony and Crystal Mine(模拟)
- Codeforces Round #259 (Div. 2) A. Little Pony and Crystal Mine(简单模拟实现题)
- Codeforces Div. 2 #259-A. Little Pony and Crystal Mine
- Codeforces Round #259 (Div. 2) A. Little Pony and Crystal Mine
- Codeforces Round #259 (Div. 2) A-Little Pony and Crystal Mine
- Codeforces Round #259 (Div. 2) A.Little Pony and Crystal Mine
- Codeforces Round #259 (Div. 2) A. Little Pony and Crystal Mine
- Codeforces Round #259 (Div. 2) problemsA Little Pony and Crystal Mine
- Codeforces 454A. Little Pony and Crystal Mine
- Codeforces 454A Little Pony and Crystal Mine(水题)
- codeforces 454A Little Pony and Crystal Mine
- A. Little Pony and Crystal Mine
- A. Little Pony and Crystal Mine
- CF 454A(Little Pony and Crystal Mine-画图[水])
- cf 454A Little Pony and Crystal Mine
- Codeforces Round #259 (Div. 2) B. Little Pony and Sort by Shift(模拟)
- CF 453A . Little Pony and Crystal Mine
- Codeforces Round #259 (Div. 1) A. Little Pony and Expected Maximum
- ASP.NET __doPostBack函数
- python中使用Element操作xml
- 生产者消费者问题
- noip2003 数字游戏 (区间动归)
- Python--递归函数
- Codeforces Round #259 (Div. 2) 454A Little Pony and Crystal Mine(模拟)
- linux的常用命令
- 从零开始学Java之IO字符流懒人模式(自动生成属性类,方法类,界面类)
- Activity的生命周期,activity跳转到activity
- 两个会导致程序崩溃的注意点
- XX日历简单逆向分析
- Python包管理工具——Pip
- Spring中MultipartHttpServletRequest实现文件上传
- geohash:用字符串实现附近地点搜索