static void Main(string[] args)
{
////无参无反
//cz();
////无参有返
//bool bbb = chaz();
//if (bbb == true)
//{
// Console.WriteLine("找到啦");
//}
//else
//{
// Console.WriteLine("没找到");
//}
////有参无返
//Console.WriteLine("请输入一个数");
//int d = Convert.ToInt32(Console.ReadLine());
//chazhao(d);
////有参有返
//Console.WriteLine("请输入一个数");
//int d = Convert.ToInt32(Console.ReadLine());
//bool b = chazhaoaaa(d);
//if (b == true)
//{
// Console.WriteLine("找到啦");
//}
//else
//{
// Console.WriteLine("没找到");
//}
}
//有参有返
static bool chazhaoaaa(int d)
{
int[] a = new int[10] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 0 };
bool b = false;
for (int i = 0; i < a.Length; i++)
{
if (a[i] == d)
{
b = true;
break;
}
}
return b;
}
//有参无返
static void chazhao(int d)
{
int[] a = new int[10] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 0 };
bool b = false;
for (int i = 0; i < a.Length; i++)
{
if (a[i] == d)
{
b = true;
break;
}
}
if (b == true)
{
Console.WriteLine("找到啦");
}
else
{
Console.WriteLine("没找到");
}
}
//查找 无参有返
static bool chaz()
{
bool b = false;
Console.WriteLine("请输入一个数");
int d = Convert.ToInt32(Console.ReadLine());
int[] a = new int[10] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 0 };
for (int i = 0; i < a.Length; i++)
{
if (a[i] == d)
{
b = true;
break;
}
}
return b;
}
//查找 无参无反
static void cz()
{
Console.WriteLine("请输入一个数");
int d=Convert.ToInt32(Console.ReadLine());
int[] a = new int[10] { 1,2,3,4,5,6,7,8,9,0};
bool b=false;
for (int i = 0; i < a.Length; i++)
{
if (a[i]==d)
{
b = true;
break;
}
}
if (b == true)
{
Console.WriteLine("找到啦");
}
else
{
Console.WriteLine("没找到");
}