CodeForces 989C
2024-10-01 12:56:28
题意略。
思路:如图
详见代码:
#include<bits/stdc++.h>
#define maxn 55
using namespace std; char board[maxn][maxn]; void init(){
for(int i = ;i <= ;++i){
for(int j = ;j <= ;++j){
board[i][j] = 'A';
}
}
for(int i = ;i <= ;++i){
for(int j = ;j <= ;++j){
board[i][j] = 'B';
}
}
for(int i = ;i <= ;++i){
for(int j = ;j <= ;++j){
board[i][j] = 'C';
}
}
for(int i = ;i <= ;++i){
for(int j = ;j <= ;++j){
board[i][j] = 'D';
}
}
} int main(){
init();
int a,b,c,d;
scanf("%d%d%d%d",&a,&b,&c,&d);
--a,--b,--c,--d;
for(int i = ;i <= ;i += ){
if(a == ) break;
for(int j = ;j <= ;j += ){
if(a == ) break;
board[i][j] = 'A';
--a;
}
}
for(int i = ;i <= ;i += ){
if(b == ) break;
for(int j = ;j <= ;j += ){
if(b == ) break;
board[i][j] = 'B';
--b;
}
}
for(int i = ;i <= ;i += ){
if(c == ) break;
for(int j = ;j <= ;j += ){
if(c == ) break;
board[i][j] = 'C';
--c;
}
}
for(int i = ;i <= ;i += ){
if(d == ) break;
for(int j = ;j <= ;j += ){
if(d == ) break;
board[i][j] = 'D';
--d;
}
}
printf("50 50\n");
for(int i = ;i <= ;++i){
for(int j = ;j <= ;++j){
printf("%c",board[i][j]);
}
printf("\n");
} return ;
}
最新文章
- Apache Shiro系列二,概述 —— 基本概念
- WinForm窗体嵌入
- js实现倒计时效果
- The content of the adapter has changed but ListView did not receive a notification
- sql: sq_helptext
- MongoDB学习笔记——数据库安装及配置
- 转:C/C++中,空数组、空类、类中空数组的解析及其作用
- android 自动化压力测试-monkey 3 命令参数
- 雷军的B面:那些赔到血本无归的失败投资案例
- 将日志写入Debug窗口
- 32位程序在64位系统上获取系统安装时间(要使用KEY_WOW64_64KEY标记)
- Android的root学习
- 如何在自己的网页上插入一个超链接,发起临时qq会话
- Encryption and decryption、Steganography、Decryption Tools
- IDEA配合Flash CS6开发Flash项目--配置篇
- systemctl命令是系统服务管理器指令,它实际上将 service 和 chkconfig 这两个命令组合到一起。
- srilm使用杂记
- [转]Android适配器之ArrayAdapter、SimpleAdapter和BaseAdapter的简单用法与有用代码片段
- android.animation(3) - ValueAnimator-ofObject(TypeEvaluator evaluator, Object... values)
- jetbrains系列激活
热门文章
- 月薪12k的零基础自学前端必备手册
- 使用.net core基于Razor Pages开发网站一些工作笔记
- mount命令中offset参数的意义
- sort+结构体+简单数学+暴力-例题
- (读论文)推荐系统之ctr预估-NFM模型解析
- python pip安装requests库总提示:Fatal error in launcher...&#39;&#39;
- IDEA自定义配置
- Golang版本的rocksdb-对gorocksdb的封装
- JAVA并发之阻塞队列浅析
- web渗透---第一天