Ответ:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Global
{
class Program
public int k, s;
static void Main(string[] argv)
Program Obj = new Program();
Obj.Calculate();
}
public void Calculate()
string iN = Console.ReadLine();
int n = Convert.ToInt16(iN);
k = 0;
s = 0;
for (int i = 1; i <= n; i++)
if (n % i == 0)
Console.WriteLine(Convert.ToString(i), ' ');
k++;
s += i;
Console.WriteLine(s);
Console.WriteLine(k);
Console.ReadKey();
Объяснение:
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Ответ:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Global
{
class Program
{
public int k, s;
static void Main(string[] argv)
{
Program Obj = new Program();
Obj.Calculate();
}
public void Calculate()
{
string iN = Console.ReadLine();
int n = Convert.ToInt16(iN);
k = 0;
s = 0;
for (int i = 1; i <= n; i++)
{
if (n % i == 0)
{
Console.WriteLine(Convert.ToString(i), ' ');
k++;
s += i;
}
}
Console.WriteLine(s);
Console.WriteLine(k);
Console.ReadKey();
}
}
}
Объяснение: