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 Test_förklaring
- {
- class Program
- {
- static void Main(string[] args)
- {
- Console.WriteLine("Skriv sidor på rektanglar");
- int sida = int.Parse(Console.ReadLine());
- Console.WriteLine("Skriv bredd på rutnätet");
- int bredd = int.Parse(Console.ReadLine());
- Console.WriteLine("skriv höjd på rutnätet");
- int höjd = int.Parse(Console.ReadLine());
- for (int i = 0; i < höjd; i++)
- {
- for (int j = 0; j < sida; j++)
- {
- for (int k = 0; k < bredd; k++)
- {
- for (int l = 0; l < sida; l++)
- {
- if (i % 2 != 0 && j % 2 != 0)
- {
- Console.Write("X");
- }
- if (i % 2 != 0 && j % 2 == 0)
- {
- Console.Write("O");
- }
- if (i % 2 != 0 && j % 3 != 0)
- {
- Console.Write("H");
- }
- if (i % 2 != 0 && j % 3 == 0)
- {
- Console.Write("H");
- }
- if (i % 2 == 0 && j % 2 != 0)
- {
- Console.Write("O");
- }
- if (i % 2 == 0 && j % 2 == 0)
- {
- Console.Write("X");
- }
- if (i % 2 == 0 && j % 3 != 0)
- {
- Console.Write("H");
- }
- if (i % 2 == 0 && j % 3 == 0)
- {
- Console.Write("H");
- }
- }
- Console.Write(" ");
- }
- Console.WriteLine();
- }
- Console.WriteLine();
- }
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement