djelad1

Untitled

Nov 22nd, 2014
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. switch (option)
  2. {
  3. case 10:
  4. {
  5. cout << "please enter " << SIZE3 << " numbers : ";
  6. int arr[SIZE3] = { 0 }, i = 0, j = 0, maxIndex = 0;
  7. for (i = 0; i < SIZE3; i++)
  8. cin >> arr[i];
  9. maxIndex = 0;
  10. for (i = 0; i < SIZE3; i++)
  11. {
  12. if (arr[i] > arr[maxIndex])
  13. maxIndex = i;
  14. }
  15. for (i = arr[maxIndex]; i > 0; i--)
  16. {
  17. for (j = 0; j < SIZE3; j++)
  18. {
  19.  
  20. if (arr[j] >= i)
  21. {
  22. cout << "* ";
  23. }
  24. else
  25. {
  26. cout << " ";
  27. }
  28. }
  29. cout << endl;
  30. }
  31. cout << "------------\n";
  32. cout << arr[0] << " " << arr[1] << " " << arr[2] << " " << arr[3] << " " << endl;
  33. }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment