当前位置:网站首页>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;
}
边栏推荐
- Haut OJ 1352: string of choice
- Introduction to memory layout of FVP and Juno platforms
- 【ES实战】ES上的native realm安全方式使用
- [es practice] use the native realm security mode on es
- Solon Auth 认证框架使用演示(更简单的认证框架)
- What is the agile proportion of PMP Exam? Dispel doubts
- Haut OJ 1350: choice sends candy
- [轉]: OSGI規範 深入淺出
- [转]:Apache Felix Framework配置属性
- [binary search] 69 Square root of X
猜你喜欢
随机推荐
xftp7与xshell7下载(官网)
A three-dimensional button
UE fantasy engine, project structure
利用HashMap实现简单缓存
YOLOv5添加注意力機制
Data is stored in the form of table
cocos_ Lua loads the file generated by bmfont fnt
Introduction to memory layout of FVP and Juno platforms
[turn]: Apache Felix framework configuration properties
记录QT内存泄漏的一种问题和解决方案
[speed pointer] 142 circular linked list II
软件测试 -- 0 序
On-off and on-off of quality system construction
object serialization
Transport connection management of TCP
Collapse of adjacent vertical outer margins
质量体系建设之路的分分合合
Add level control and logger level control of Solon logging plug-in
Introduction to tools in TF-A
Development error notes