fork download
  1. #include<iostream>
  2. using namespace std;
  3. int main()
  4. {
  5. int r=0,n[100];
  6. cout<<"Enter a Positive Integer \n";
  7. cin>>r;
  8. cout<<"r="<<r<<"\n";
  9. if(r<100)
  10. {
  11. cout<<"Enter r intergers \n";
  12. for(int i=0;i<r;i++)
  13. {
  14. cin>>n[i];
  15.  
  16. }
  17. cout<<"Printing Stars \n";
  18. for(int j=0;j<r;j++)
  19. {
  20. for(int k=0;k<n[j];k++)
  21. {
  22. cout<<"*";
  23. }
  24. cout<<"\n";
  25. }
  26. }
  27. return 0;
  28. }
Success #stdin #stdout 0s 2900KB
stdin
5 2 3 4 4 5
stdout
Enter a Positive Integer 
r=5
Enter r intergers 
Printing Stars 
**
***
****
****
*****