Guest User

Untitled

a guest
Jan 10th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. int main() {
  6.  
  7. int count = 10;
  8. int data[count] = {10,5,8,7,3,15,13,23,14,20};
  9. string character = "^";
  10.  
  11. int hrow = 0;
  12.  
  13. for(int i=0;i<count;i++){
  14. if(data[i]>hrow){
  15. hrow=data[i];
  16. }
  17. }
  18.  
  19. string vStr[hrow][count];
  20.  
  21. for(int i=0; i<hrow; i++){
  22. for(int j=0; j<count; j++){
  23.  
  24. if(i >=data[j]){
  25. vStr[i][j]= " ";
  26. }else {
  27. vStr[i][j]= "$";
  28. }
  29.  
  30. }
  31. }
  32.  
  33. for(int i=0; i<hrow; i++){
  34. for(int j=0; j<count; j++){
  35. cout<<vStr[i][j]<<" | ";
  36. }
  37. cout<<"\n";
  38. }
  39.  
  40. }
Advertisement
Add Comment
Please, Sign In to add comment