Advertisement
rahat62

Toph-Count the Odds

Jan 31st, 2019
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.21 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4.    int m,n,count=0;
  5.    scanf("%d %d",&m,&n);
  6.    if(n%2==0 && m%2==0)
  7.    {
  8.        count = ((n-m)/2);
  9.    }
  10.    else
  11.    count=((n-m)/2)+1;
  12.    printf("%d\n",count);
  13.    return 0;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement