
Untitled
By: a guest on
Dec 24th, 2012 | syntax:
None | size: 1.05 KB | hits: 17 | expires: Never
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
int people = 0;
int passengers = 0;
double drivers = 0;
Console.Write("Enter the number of the passenger: ");
passengers = int.Parse(Console.ReadLine());
drivers = passengers / 5;
drivers = Math.Ceiling(drivers);
Console.Write(drivers); // פה זה אמור להדפיס לי 2 בהנחה שמספר הנוסעים הוא 8 וזה מדפיס 1 !
people = passengers + (int)drivers;
if (people % 6 == 0)
{
Console.WriteLine("You should order: " + people / 6 + " taxies.");
}
else if (people % 6 != 0)
{
people = ((people / 6) + 1);
Console.WriteLine("You should order: " + people + " taxies.");
}
}
}
}