Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int r;
- cout << "vvedi skolko strochek:";
- cin >> r;
- int a[r];
- int q=0;
- int x=0;
- int b;
- while (q<r){
- cout << "vvedi kakoi-to chislo:";
- cin >> a[q];
- if (a[q]==0){
- q=r;
- }
- q++;
- }
- q=0;
- int e=0;
- while (q<r) {
- if (a[q]>e){
- e=a[q];
- }
- q++;
- }
- q=0;
- while (a[q]!=0 && q<r){
- b=0;
- x=q;
- while (a[x]<e) {
- cout << " ";
- a[x]=a[x]+2;
- b=b+2;
- }
- a[x]=a[x]-b;
- while (a[x]>0){
- cout << "*";
- a[x]=a[x]-1;
- }
- cout << endl;
- q++;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement