#include<iostream>
using namespace std;
const int N = 5;
void main()
{
char str[N][20], (*p)[20] = str, a[N];
cout << "输入数组元素" << endl;
int i;
for (i = 0; i < N; i++)
cin >> *(p + i);
char *ptfind = a;
cout << "输入要查找的元素" << endl;
cin >> a;
int k=0;
for (i = 0; i < N; i++)
{
if (strcmp(*(p + i), (char*)ptfind) == 0)
{
cout << "找到了" << endl;
k = 1;
}
}
if (k==0)
cout << "没找到" << endl;
using namespace std;
const int N = 5;
void main()
{
char str[N][20], (*p)[20] = str, a[N];
cout << "输入数组元素" << endl;
int i;
for (i = 0; i < N; i++)
cin >> *(p + i);
char *ptfind = a;
cout << "输入要查找的元素" << endl;
cin >> a;
int k=0;
for (i = 0; i < N; i++)
{
if (strcmp(*(p + i), (char*)ptfind) == 0)
{
cout << "找到了" << endl;
k = 1;
}
}
if (k==0)
cout << "没找到" << endl;