Advertisement
royroy23

Untitled

Jan 28th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.68 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ConsoleApplication23
  8. {
  9. class Program
  10. {
  11. static int copasitya(int a, int b)
  12. {
  13. int c;
  14. c = a / b;
  15. if ((a % b) == 0)
  16. c++;
  17. return c;
  18.  
  19. }
  20. static int copasityb(int a, int b)
  21. {
  22. int c;
  23. c = a / b;
  24. if ((a % b) == 0)
  25. c++;
  26. return c;
  27.  
  28. }
  29. static int copasityc(int a, int b)
  30. {
  31. int c;
  32. c = a / b;
  33. if ((a % b) == 0)
  34. c++;
  35. return c;
  36.  
  37. }
  38. static void Main(string[] args)
  39. {
  40. int guests, bussesc, boatsc, tablesc, busses, boats, tables;
  41. Console.WriteLine("How many guests did you invited?");
  42. guests = int.Parse(Console.ReadLine());
  43. Console.WriteLine("What is the busses copasity?");
  44. bussesc = int.Parse(Console.ReadLine());
  45. Console.WriteLine("what is the boats copasity?");
  46. boatsc = int.Parse(Console.ReadLine());
  47. Console.WriteLine("what is the tables copasity?");
  48. tablesc = int.Parse(Console.ReadLine());
  49. busses = copasitya(bussesc, guests);
  50. boats = copasityb(boatsc, guests);
  51. tables = copasityc(tablesc, guests);
  52. Console.WriteLine("You need:");
  53. Console.WriteLine(busses + " busses.");
  54. Console.WriteLine(boats + " boats.");
  55. Console.WriteLine(tables + " tables.");
  56. }
  57. }
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement