Guest User

Untitled

a guest
Nov 24th, 2017
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.37 KB | None | 0 0
  1.             int boy, girl,i,c,p,a,b,d;
  2.             c=1;
  3.             Console.WriteLine("ata/at lo yeholim la'avod alay! mispar habanim hayav lihyot gadol mi'mispar habanot");
  4.             Console.WriteLine();
  5.             Console.WriteLine("please insert the number of boys: ");
  6.             boy = int.Parse(Console.ReadLine());
  7.             Console.WriteLine("please insert the number of girls: ");
  8.             girl = int.Parse(Console.ReadLine());
  9.             for (i = 1; i <= c; i++)
  10.             {
  11.                 if (girl > boy)
  12.                 {
  13.                     c++;
  14.                     Console.WriteLine("tin tin tin !!wrong!! the number of boy must be bigger then girls!! try again");
  15.                     Console.WriteLine("boys: ");
  16.                     boy = int.Parse(Console.ReadLine());
  17.                     Console.WriteLine("girls: ");
  18.                     girl = int.Parse(Console.ReadLine());
  19.                 }
  20.                 else
  21.                 {
  22.                     p = boy - girl;
  23.                     Console.WriteLine("the hefresh between boy to girls is: " + p);
  24.                     a = boy + girl;
  25.                     Console.WriteLine("the number of students in the class is: " + a);
  26.                     b = a - p;
  27.                     d = b / 2;
  28.                     Console.WriteLine("the number of zugot is: " +d);
  29.                 }
  30.  
  31.             }
Add Comment
Please, Sign In to add comment