MuffinMonster

Class Task 39#

Dec 11th, 2013
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.79 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace ConsoleApplication1
  7. {
  8.     class Program
  9.     {
  10.         static void Malben(int x, int y)
  11.         {
  12.             int s, p, x2, y2, s2, p2;
  13.             double alahson, alahson2;
  14.             s = x * y;
  15.             Console.WriteLine("Shetah = " + s);
  16.             p = (x * 2) + (y * 2);
  17.             Console.WriteLine("Oreh = " + p);
  18.             alahson = Math.Sqrt(x * x + y * y);
  19.             Console.WriteLine("Alahson = " + alahson);
  20.             Console.WriteLine();
  21.             for (int i = 1; i <= x; i++)
  22.             {
  23.                 for (int j = 1; j <= y; j++)
  24.                 {
  25.                     Console.Write("*");
  26.                 }
  27.                 Console.WriteLine();
  28.             }
  29.             Console.WriteLine();
  30.             x2 = x * 2;
  31.             y2 = y + 3;
  32.             s2 = x2 * y2;
  33.             Console.WriteLine("Shetah = " + s2);
  34.             p2 = (x2 * 2) + (y2 * 2);
  35.             Console.WriteLine("Oreh = " + p2);
  36.             alahson2 = Math.Sqrt(x2 * x2 + y2 * y2);
  37.             Console.WriteLine("Alahson = " + alahson2);
  38.             Console.WriteLine();
  39.             for (int i = 1; i <= x2; i++)
  40.             {
  41.                 for (int j = 1; j <= y2; j++)
  42.                 {
  43.                     Console.Write("*");
  44.                 }
  45.                 Console.WriteLine();
  46.             }
  47.            
  48.         }
  49.         static void Main(string[] args)
  50.         {
  51.             Console.WriteLine("Enter the X:");
  52.             int x = int.Parse(Console.ReadLine());
  53.             Console.WriteLine("Enter the Y:");
  54.             int y = int.Parse(Console.ReadLine());
  55.             Console.WriteLine();
  56.             Malben(x, y);
  57.             Console.ReadKey();
  58.         }
  59.     }
  60. }
Add Comment
Please, Sign In to add comment