/*
* Created by SharpDevelop.
* User: user
* Date: 04.11.2022
* Time: 13:54
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
namespace Hodisalar_bilan_ishlash
{
delegate bool tubmi(int k);
delegate void tubson(int k);
class Program
{
static tubmi tub=x =>
{
bool m=true;
for(int i=2;i<=Math.Sqrt(x);i++)
{
if(x%i==0)
{
m=false;break;
}
}
return m;
};
static tubson Tubson=x =>
{
for(int i=2;i<=x;i++)
{
if(tub(i)) Console.WriteLine(i);
}
};
public static void Main(string[] args)
{
/*2*/
Console.Write("Biror son kiriting: ");
int k=0;
try
{
k=int.Parse(Console.ReadLine());
}
catch
{
Console.WriteLine("xatolik!");
}
Tubson(k);
Console.ReadKey(true);
}
/*0*/
}
/*1*/
}
Do'stlaringiz bilan baham: |