Advertisement
EgorPodvalkov

массивы с

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