using System;
namespace ConsoleApp19
{
class Program
{
public static char d;
public static void Main(string[] args)
{
Console.WriteLine("Введите начальное число");
int a = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Введите конечное число");
int b = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Введите кратное число");
int c = Convert.ToInt32(Console.ReadLine());
int sum = 0;
int s = a;
while (s < b)
{
int k = s % c;
switch (d)
{
case '%':
k = 0;
break;
}
sum = sum + k;
Console.WriteLine(sum);
s++;
}
}
}
}
using System;
namespace sum_of_dividends
{
class Program
{
public static void Main(string[] args)
{
Console.WriteLine("Введите начальное число");
var a = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Введите конечное число");
var b = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Введите кратное число");
var c = Convert.ToInt32(Console.ReadLine());
var sum = 0;
for (var x = a; x <= b; x++)
if ((x % c) == 0)
sum += x;
Console.WriteLine(sum);
}
}
}
using System;
namespace sum_of_dividends
{
class Program
{
public static void Main(string[] args)
{
Console.WriteLine("Введите начальное число");
var a = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Введите конечное число");
var b = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Введите кратное число");
var c = Convert.ToInt32(Console.ReadLine());
var sum = 0;
for (var x = a; x <= b; x++)
switch (x % c)
{
case 0: sum += x; break;
default: break;
}
Console.WriteLine(sum);
}
}
}
using System;
namespace sum_of_dividends
{
class Program
{
public static void Main(string[] args)
{
Console.WriteLine("Введите начальное число");
var a = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Введите конечное число");
var b = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Введите кратное число");
var c = Convert.ToInt32(Console.ReadLine());
var sum = 0;
var x = a;
while (x <= b)
{
switch (x % c)
{
case 0: sum += x; break;
default: break;
}
x++;
}
Console.WriteLine(sum);
}
}
}