Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Exam30August2015
- {
- class StripedTowel
- {
- static void Main()
- {
- int width = int.Parse(Console.ReadLine());
- double height= Math.Floor(width * 1.5);
- string symbol = "";
- int counter = 1;
- for (int i = 0; i < height; i++)
- {
- for (int j = 0; j < width; j++)
- {
- if (counter==1)
- {
- symbol = "#..";
- }
- else if (counter == 2)
- {
- symbol = "..#";
- }
- else
- {
- symbol = ".#.";
- }
- if (j==0)
- {
- Console.Write(symbol[j]);
- }
- else
- {
- Console.Write(symbol[j % symbol.Length]);
- }
- }
- counter++;
- if (counter>3)
- {
- counter = 1;
- }
- Console.WriteLine();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement