fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. // your code goes here
  6. int s,i,n=5,j;
  7. char a='A';
  8. s=0;
  9. for(i=1;i<=n;i++){
  10. a='A';
  11. for(j=1;j+i<2*n&&i+j>n;j++){
  12.  
  13. a= 'A' + s;
  14. cout<<a;
  15. s++;
  16. s=s%5;
  17.  
  18. }
  19. cout<<"\n";
  20. }
  21. return 0;
  22. }
Success #stdin #stdout 0.01s 5288KB
stdin
Standard input is empty
stdout



ABCD