Advertisement
Hazem3529

fixed

Mar 21st, 2015
448
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace ConsoleApplication16
  7. {
  8.     class Program
  9.     {
  10.         static void Main(string[] args)
  11.         {
  12.             int x;
  13.             int sum = 0;
  14.  
  15.            
  16.             int y;
  17.             x = int.Parse(Console.ReadLine());
  18.             y = int.Parse(Console.ReadLine());
  19.  
  20.             for (int i = x; i < y; i++)
  21.             {
  22.                
  23.                 if (sum %2 !=0 )
  24.                   sum = sum + i;
  25.             }
  26.            
  27.                   Console.WriteLine(sum);
  28.  
  29.  
  30.         }
  31.     }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement