当前位置:网站首页>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;
}
边栏推荐
- Fragment addition failed error lookup
- Listview pull-down loading function
- [binary search] 34 Find the first and last positions of elements in a sorted array
- Service fusing hystrix
- 小程序直播+電商,想做新零售電商就用它吧!
- win10虚拟机集群优化方案
- A complete attack chain
- 软件测试 -- 0 序
- 远程升级怕截胡?详解FOTA安全升级
- Use of snippets in vscode (code template)
猜你喜欢
随机推荐
To be continued] [UE4 notes] L4 object editing
[to be continued] [UE4 notes] L2 interface introduction
Ue4/ue5 illusory engine, material part (III), material optimization at different distances
Do a small pressure test with JMeter tool
Applet live + e-commerce, if you want to be a new retail e-commerce, use it!
xftp7与xshell7下载(官网)
Simple HelloWorld color change
A preliminary study of sdei - see the essence through transactions
[turn]: OSGi specification in simple terms
利用HashMap实现简单缓存
To the distance we have been looking for -- film review of "flying house journey"
A three-dimensional button
使用Room数据库报警告: Schema export directory is not provided to the annotation processor so we cannot expor
Transport connection management of TCP
2022年上半年国家教师资格证考试
Magnifying glass effect
Solon Logging 插件的添加器级别控制和日志器的级别控制
[trans]: spécification osgi
2022上半年全国教师资格证下
[to be continued] I believe that everyone has the right to choose their own way of life - written in front of the art column