Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4.  
  5. int main()
  6. {
  7. int choice;
  8. int i; int j; int k;
  9. int space;
  10.  
  11. cout << "give me a diamond size= ";
  12. cin >> choice;
  13.  
  14. /*space = choice - 1;
  15. for (k = 1; k <= choice; k++)
  16. {
  17. for (i = 1; i <= space; i++)
  18. {
  19. cout << " ";
  20. }
  21. space--;
  22. for (j = 1; j <= (2 * i - 1); j++)
  23. {
  24. cout << "*";
  25. }
  26. cout << endl;
  27. }
  28.  
  29. cout << endl; // L\1ine break
  30.  
  31. }//end outer loop*/
  32.  
  33. for (i = choice; i > 0; i--) {
  34. for (j = 1; j <= i; j++) {
  35. cout << "*";
  36. }
  37. cout << endl;
  38. }
  39.  
  40. system("PAUSE");
  41. return 0;
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement