Advertisement
Kamigawa

4.11.Numbers in Interval Dividable by Given Number

Oct 5th, 2014
265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. using System;
  2.  
  3. class DivideByGivenNumber
  4. {
  5. static void Main()
  6. {
  7. int firstN = int.Parse(Console.ReadLine());
  8. int seconfN = int.Parse(Console.ReadLine());
  9. int dif = seconfN - firstN;
  10. int sum = 0;
  11. for (int i = firstN; i <= seconfN; i++)
  12. {
  13. if (i % 5 == 0)
  14. {
  15. sum += 1; ;
  16. }
  17. }
  18. Console.WriteLine("p= {0}", sum);
  19. }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement