当前位置:网站首页>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;
}
边栏推荐
猜你喜欢
Research on the value of background repeat of background tiling
[trans]: spécification osgi
[to be continued] [UE4 notes] L2 interface introduction
质量体系建设之路的分分合合
利用HashMap实现简单缓存
对象的序列化
YOLOv5-Shufflenetv2
[to be continued] [depth first search] 547 Number of provinces
十年不用一次的JVM调用
A new micro ORM open source framework
随机推荐
一个新的微型ORM开源框架
Listview is added and deleted at the index
使用Room数据库报警告: Schema export directory is not provided to the annotation processor so we cannot expor
[es practice] use the native realm security mode on es
Grail layout and double wing layout
[turn]: Apache Felix framework configuration properties
[binary search] 69 Square root of X
Quick sort summary
发现一个很好的 Solon 框架试手的教学视频(Solon,轻量级应用开发框架)
Insert sort
[speed pointer] 142 circular linked list II
Applet live + e-commerce, if you want to be a new retail e-commerce, use it!
Fragment addition failed error lookup
A preliminary study of sdei - see the essence through transactions
The next key of win generates the timestamp file of the current day
win下一键生成当日的时间戳文件
Pointnet++学习
2022/7/1 learning summary
[turn to] MySQL operation practice (I): Keywords & functions
Development error notes