当前位置:网站首页>Zzulioj 1673: b: clever characters???
Zzulioj 1673: b: clever characters???
2022-07-05 05:20:00 【hunziHang】
Problem description :
Given a m That's ok n The character matrix of the column , Please fill in this matrix in alphabetical order .
Input :
Enter two positive integers m,n.(m<=20,n<=20)
Output :
Output the character matrix to be printed , Add before and after each line ‘>’ ‘<’( Does not contain single quotes )
The sample input :
3 10
Sample output :
>abcdefghij< >klmnopqrst< >uvwxyzabcd<
Cause analysis :
Handle character loops : Can pass asc Code to achieve , namely (char)('a'+idx%26)
Solution :
#include<bits/stdc++.h>
using namespace std;
int main()
{
int m,n,idx=0,i,j;
cin>>m>>n;
for(i=0;i<m;i++)
{
cout<<">";
for(j=0;j<n;j++,idx++)
{
cout<<(char)('a'+idx%26);
}
cout<<"<"<<endl;
}
return 0;
}边栏推荐
- Generate filled text and pictures
- The next key of win generates the timestamp file of the current day
- Kali 2018 full image download
- ssh免密登录设置及使用脚本进行ssh登录并执行指令
- Cocos2dx screen adaptation
- Yolov5 ajouter un mécanisme d'attention
- [es practice] use the native realm security mode on es
- [depth first search] 695 Maximum area of the island
- Haut OJ 1243: simple mathematical problems
- 小程序直播+电商,想做新零售电商就用它吧!
猜你喜欢

Use of snippets in vscode (code template)

Ue4/ue5 illusory engine, material part (III), material optimization at different distances

Bucket sort

sync.Mutex源码解读
![[turn]: OSGi specification in simple terms](/img/54/d73a8d3e375dfe430c2eca39617b9c.png)
[turn]: OSGi specification in simple terms

Shell Sort

Django reports an error when connecting to the database. What is the reason

Learning notes of "hands on learning in depth"

Data is stored in the form of table

Page countdown
随机推荐
YOLOv5添加注意力机制
[to be continued] [UE4 notes] L1 create and configure items
Embedded database development programming (V) -- DQL
[to be continued] [depth first search] 547 Number of provinces
MySQL数据库(一)
Double pointer Foundation
Romance of programmers on Valentine's Day
Lua determines whether the current time is the time of the day
cocos2dx_ Lua particle system
2022/7/1學習總結
A preliminary study of sdei - see the essence through transactions
Haut OJ 1321: mode problem of choice sister
质量体系建设之路的分分合合
cocos2dx_ Lua card flip
利用HashMap实现简单缓存
Web APIs DOM节点
Yolov5 ajouter un mécanisme d'attention
YOLOv5添加注意力機制
SDEI初探-透过事务看本质
Pointnet++学习