Advertisement
_Kripaka001_

exercise 3(b)

Apr 10th, 2017
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int y,x,c,v,i,max;
  6. int a[i];
  7. i = 0;
  8. max = 0;
  9. cout << "vvedi chislo cifer skolko ti hotheh vvesty "<< endl;
  10. cin >> x;
  11.  
  12. while (i < x)
  13. {
  14. cout << "vvedi chislo" << i;
  15. cout << endl;
  16. cin >> a[i];
  17. cout << endl;
  18. i++;
  19. }
  20.  
  21. i = 0;
  22. while (i < x)
  23. {
  24. if (a[i] > max)
  25. {
  26. max = a[i] ;
  27. }
  28. }
  29.  
  30. i = 0;
  31. while (i < max*x)
  32. {
  33. if (a[i] > 1)
  34. {
  35. cout << "*" ;
  36. a[i] = a[i] - 1;
  37. }
  38. else
  39. {
  40. cout << " " ;
  41. }
  42. i++;
  43. }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement