fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. ios::sync_with_stdio(0);
  6. int i,T,N,g,r;
  7. cin>>T;
  8. while(T--){
  9. cin>>N;
  10. r=N%26;
  11. g=(N-r)/26;
  12. char a[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'};
  13. for(i=0;i<g;i++)
  14. cout<<a;
  15. for(i=0;i<r;i++){
  16. cout<<a[i];
  17. }
  18. cout<<endl;
  19. }
  20. return 0;
  21. }
Success #stdin #stdout 0s 3456KB
stdin
2
15
54
stdout
abcdefghijklmno
abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzab