https://codeforces.com/contest/1092/problem/A
题解:
按顺序打字母???
/*
*@Author: STZG
*@Language: C++
*/
#include <bits/stdc++.h>
#include<iostream>
#include<algorithm>
#include<cstdlib>
#include<cstring>
#include<cstdio>
#include<string>
#include<vector>
#include<bitset>
#include<queue>
#include<deque>
#include<stack>
#include<cmath>
#include<list>
#include<map>
#include<set>
//#define DEBUG
#define RI register int
using namespace std;
typedef long long ll;
//typedef __int128 lll;
const int N=10000;
const int MOD=1e9+7;
const double PI = acos(-1.0);
const double EXP = 1E-8;
const int INF = 0x3f3f3f3f;
int t,n,m,k,q;
int main()
{
#ifdef DEBUG
freopen(\"input.in\", \"r\", stdin);
//freopen(\"output.out\", \"w\", stdout);
#endif
scanf(\"%d\",&t);
while(t--){
scanf(\"%d%d\",&n,&m);
int e=min(m,26);
q=n/e;
k=n-e*q;
for(int i=\'a\';i<\'a\'+e;i++){
for(int j=1;j<=q;j++)
printf(\"%c\",i);
if(k>0){
k--;
printf(\"%c\",i);
}
}
printf(\"\\n\");
}
//cout << \"Hello world!\" << endl;
return 0;
}
继续阅读与本文标签相同的文章
下一篇 :
5G套餐起步价公开:128元起步,单价更便宜
-
与你同行,才能无障碍
2026-05-18栏目: 教程
-
分布式Id - redis方式
2026-05-18栏目: 教程
-
HTML5 容器入门解析:支付宝 Hybrid 方案原理与实战
2026-05-18栏目: 教程
-
阿里云910会员节:开启时光机领会员大礼包,云产品满减优惠活动
2026-05-18栏目: 教程
-
基于宜搭的“报表分析”实践案例
2026-05-18栏目: 教程
