Advertisement
YavorJS

Bricks Revised

Jun 27th, 2016
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 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 HelloCSharp
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13.  
  14. int bricks = int.Parse(Console.ReadLine());
  15. int workers = int.Parse(Console.ReadLine());
  16. int cartVolume = int.Parse(Console.ReadLine());
  17. int totalBricksPerCourse = workers*cartVolume;
  18. int totalBricksFromAllCourses=totalBricksPerCourse;
  19. int courses = 1;
  20. while (totalBricksFromAllCourses<bricks)
  21. {
  22. courses++;
  23. totalBricksFromAllCourses += totalBricksPerCourse;
  24. }
  25. if (bricks==0||workers==0||cartVolume==0)
  26. {
  27. courses = 0;
  28. }
  29. Console.WriteLine(courses);
  30.  
  31. }
  32. }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement