Advertisement
Saint603

Untitled

Mar 4th, 2015
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. #include <iostream>
  2. #include <iomanip>
  3. #include <stdio.h>
  4. using namespace std;
  5.  
  6. int choice, width, repeats, shot;
  7.  
  8. int main () {
  9. cout << "Please select what you'd like to generate:\n";
  10. cout << "1. Triangles\n2. Dicks\n";
  11. cin >> choice;
  12.  
  13. while (choice != 1 && choice != 2) {
  14. cout << "ERROR PLEASE ENTER A VALID CHOICE\n";
  15. cin >> choice; }
  16. if (choice == 1) {
  17. printf ("Enter a width (anything less than 80 works well)\n");
  18. scanf("%d",&width);
  19. while (width > 0) {
  20. while (width > repeats) {
  21. printf ("*");
  22. repeats = repeats + 1;
  23. }
  24. printf ("\n");
  25. width = width - 1;
  26. repeats = 0;
  27.  
  28. }
  29. cin >> width;
  30. }
  31. else if (choice == 2) {
  32. cout << "Please enter a length\n";
  33. cin >> width;
  34. cout << "Please enter a shot length\n";
  35. cin >> shot;
  36. cout << "8" <<setfill('=') << setw(width);
  37. cout << "D" <<setfill('~') << setw(shot) << " ";
  38. cout<< "\nThank you for using the generator";
  39. }
  40. cin.get();
  41. return 0;
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement