Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- //Write a program which asks for a number, a width and a height and displays a rectangle of that width and that height, using that number for the inner symbol, as in this example:
- //Enter a number: 4
- //Enter the desired width: 3
- //Enter the desired height: 5
- //444
- //444
- //444
- //444
- //444
- class Program
- {
- static void Main()
- {
- char number = char.Parse(Console.ReadLine()); //could be entered a number(resp - with an int declared)
- int width = int.Parse(Console.ReadLine());
- int height = int.Parse(Console.ReadLine());
- for (int i = 1; i <= height; i++)
- {
- for (int j = 1; j <=width; j++)
- {
- Console.Write(number);
- }
- Console.WriteLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement