using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace bt_84
{
class Program
{
static void Main(string[] args)
{
int i, n,s=0;
do
{
Console.Write("nhap n="); n = int.Parse(Console.ReadLine());
} while (n <= 1 || n >= 30);
for (i = 1; i <= n; i++)
{
if (Math.Sqrt(Math.Pow(i, 2)) % 2 == 0)
s = s + i;
}
Console.Write("tong la:" + s);
Console.ReadKey();
}
}
}
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace bt_84
{
class Program
{
static void Main(string[] args)
{
int i, n,s=0;
do
{
Console.Write("nhap n="); n = int.Parse(Console.ReadLine());
} while (n <= 1 || n >= 30);
for (i = 1; i <= n; i++)
{
if (Math.Sqrt(Math.Pow(i, 2)) % 2 == 0)
s = s + i;
}
Console.Write("tong la:" + s);
Console.ReadKey();
}
}
}