fork download
  1. #include<string>
  2. class X:public std::string{public:X(int i):std::string(i*(i+1)/2,'*'){for(;i--;)insert(i*(i+1)/2,"\n");}};
  3.  
  4.  
  5. #include <iostream>
  6. using namespace std;
  7.  
  8. int main() {
  9. int i;
  10. cin >>i ;
  11. cout << X(i);
  12. return 0;
  13. }
Success #stdin #stdout 0s 3472KB
stdin
80
stdout
*
**
***
****
*****
******
*******
********
*********
**********
***********
************
*************
**************
***************
****************
*****************
******************
*******************
********************
*********************
**********************
***********************
************************
*************************
**************************
***************************
****************************
*****************************
******************************
*******************************
********************************
*********************************
**********************************
***********************************
************************************
*************************************
**************************************
***************************************
****************************************
*****************************************
******************************************
*******************************************
********************************************
*********************************************
**********************************************
***********************************************
************************************************
*************************************************
**************************************************
***************************************************
****************************************************
*****************************************************
******************************************************
*******************************************************
********************************************************
*********************************************************
**********************************************************
***********************************************************
************************************************************
*************************************************************
**************************************************************
***************************************************************
****************************************************************
*****************************************************************
******************************************************************
*******************************************************************
********************************************************************
*********************************************************************
**********************************************************************
***********************************************************************
************************************************************************
*************************************************************************
**************************************************************************
***************************************************************************
****************************************************************************
*****************************************************************************
******************************************************************************
*******************************************************************************
********************************************************************************