1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
#include <iostream>
#include <string>
#include <cstring>
using namespace std;
int main()
{
char arr[26]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
char allow[26];
int n,k,m=0;
string pass="";
cin >> n >> k;
for (int i=0;i<k;i++){
pass+=arr[j];
allow[i]=arr[j++];
}
for (int i=0;i<n-k;i++){
if (m==strlen(allow)){
m=0;
}
else{
pass+=allow[m++];
}
}
cout << pass ;
return 0;
}
|