djelad1

Untitled

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