Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

Numbers Histogram in c++

#include<iostream>
using namespace std;

int main()
{
	int n, x;
	char ch;
	cin >> ch >> n;
	for (int i = 0; i < n; i++)
	{
		cin >>x;
		for (int i = 0; i < x; i++)
		{
			cout << ch;
		}
		cout << "
";
	}
	return 0;
}
Source by codejudge.blogspot.com #
 
PREVIOUS NEXT
Tagged: #Numbers #Histogram
ADD COMMENT
Topic
Name
3+8 =