Advertisement
Guest User

Untitled

a guest
Dec 24th, 2012
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 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 Main(string[] args)
  11. {
  12. int people = 0;
  13. int passengers = 0;
  14. double drivers = 0;
  15.  
  16. Console.Write("Enter the number of the passenger: ");
  17. passengers = int.Parse(Console.ReadLine());
  18. drivers = passengers / 5;
  19. drivers = Math.Ceiling(drivers);
  20. Console.Write(drivers); // פה זה אמור להדפיס לי 2 בהנחה שמספר הנוסעים הוא 8 וזה מדפיס 1 !
  21. people = passengers + (int)drivers;
  22.  
  23. if (people % 6 == 0)
  24. {
  25. Console.WriteLine("You should order: " + people / 6 + " taxies.");
  26. }
  27.  
  28. else if (people % 6 != 0)
  29. {
  30. people = ((people / 6) + 1);
  31. Console.WriteLine("You should order: " + people + " taxies.");
  32. }
  33.  
  34. }
  35. }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement