//下面没有语法错了,不知你程序是做什么,不敢随便改!
#include
#define M 10
#define N 20
void printstr( char inputstr[][N],int lines );
void main()
{
char inputstr[M][N];
int i = 0,lines;
/*
** 输入句子。
*/
printf("please input a number ( 0 < number < 10 ):\n");
scanf("%d",&lines);
printf("input some lines ( 0< lines < 10) and every line must less than 20 character\n");
while( i <= lines)
{
gets(inputstr[i]);
i++;
}
printstr( inputstr,lines );
}
void printstr( char inputstr[][N],int lines )
{
int flag = 0 ;
int i;
for( i =0;i < lines -1;i++)
{
if(strcmp(inputstr[i],inputstr[i+1]) == 0)
{
if( flag == 0)
puts(inputstr[i]);
flag = 1;
}
else
{
flag = 0;
}
}
}