当前位置:网站首页>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;
}边栏推荐
猜你喜欢

Magnifying glass effect

Ue4/ue5 illusory engine, material part (III), material optimization at different distances
![[paper notes] multi goal reinforcement learning: challenging robotics environments and request for research](/img/17/db8614b177f33ee4f67b7d65a8430f.png)
[paper notes] multi goal reinforcement learning: challenging robotics environments and request for research

A new micro ORM open source framework

C语言杂谈1

Heap sort summary

win10虚拟机集群优化方案

The present is a gift from heaven -- a film review of the journey of the soul

Pointnet++的改进

Embedded database development programming (V) -- DQL
随机推荐
Romance of programmers on Valentine's Day
Embedded database development programming (VI) -- C API
Fragment addition failed error lookup
[to be continued] [depth first search] 547 Number of provinces
嵌入式数据库开发编程(零)
cocos_ Lua listview loads too much data
[speed pointer] 142 circular linked list II
Simple HelloWorld color change
Heap sort summary
Reverse one-way linked list of interview questions
Haut OJ 1321: mode problem of choice sister
Improvement of pointnet++
C language Essay 1
Haut OJ 1245: large factorial of CDs --- high precision factorial
Download and use of font icons
cocos2dx_ Lua particle system
[binary search] 34 Find the first and last positions of elements in a sorted array
PMP考生,请查收7月PMP考试注意事项
[转]: OSGI规范 深入浅出
Solon 框架如何方便获取每个请求的响应时间?