Advertisement
Kolimnared

DevidibleBy5

Oct 7th, 2014
271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. using System;
  2.  
  3. class NumsInIntervalDividableByFive
  4. {
  5. static void Main(string[] args)
  6. {
  7. int start = int.Parse(Console.ReadLine());
  8. int end = int.Parse(Console.ReadLine());
  9. int p = 0;
  10.  
  11. while ( start % 5 != 0 ) {
  12. ++start;
  13. if (start == end && start % 5 != 0) {
  14. Console.WriteLine(p);
  15. Environment.Exit(0);
  16. }
  17. }
  18.  
  19. p = ((end - start) / 5) + 1;
  20. Console.WriteLine(p);
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement