Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int s = 5;
- int a[s];
- int cntr, cntr2, maxi = 0;
- cntr = 0;
- while(cntr < s){
- cout << "zvezdochek v " << cntr + 1 << " stolbike: ";
- cin >> a[cntr];
- cntr++;
- }
- cntr = 0;
- while(cntr < s){
- if(maxi < a[cntr]){
- maxi = a[cntr];
- }
- cntr++;
- }
- cntr = 0;
- while(cntr < maxi){
- cntr2 = 0;
- while(cntr2 < s){
- if(cntr < a[cntr2]){
- cout << "*";
- }
- else{
- cout << " ";
- }
- cntr2++;
- }
- cout << endl;
- cntr++;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement