Advertisement
EgorPodvalkov

массивы с (1000)

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