Program.cs 190 B

1234567891011121314
  1. int N = Convert.ToInt32(Console.ReadLine());
  2. int a = 0;
  3. if (N > 1)
  4. {
  5. a = N * (N + 1) / 2;
  6. }
  7. else
  8. {
  9. for (int i = 1; i <= N; ++i)
  10. {
  11. a += i;
  12. }
  13. }
  14. Console.WriteLine(a);