fork download
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. int main() {
  6. string s;
  7. char q='a';
  8. int n,k,i,j;
  9. cin >> n;
  10. for (i=0, k=n-1; i<n; i++, k--) {
  11. s=s+q;
  12. q++;
  13. cout << 'a';
  14. for (j=0; j<k; j++) cout << " ";
  15. cout << s << "\n";
  16. }
  17. return 0;
  18. }
Success #stdin #stdout 0s 15240KB
stdin
7
stdout
a      a
a     ab
a    abc
a   abcd
a  abcde
a abcdef
aabcdefg