#include
#include
void main (void)
{
char list [5][80];
char string [80];
int start,end,i,temp;
for (i=0 ; i <=4; i++)
{
printf("Please input list [%d] data\n",i);
scanf("%s",list [i]);
}
printf("Please input the start line to be printed \n");
scanf("%d",& start);
printf("Please input the end line to be printed\n");
scanf("%d",& end);
for (i= start ; i<=end ; i++)
{
printf("%s\n",list[i]);
}
printf("Please input the string to be compared\n");
scanf("%s", string);
temp=0;
for (i=0; i<=4 ; i++)
{
if (strcmp(string,list[i])==0)
{
printf("line[%d] exists the string\n",i);
temp++;
}
}
if(temp==0)
printf("Not Exist\n");
printf("Please input the start line to be delete\n");
scanf("%d",& start);
printf("Please input the end line to be delete\n");
scanf("%d",& end);
for (i= start ; i<=end ; i++)
{
strcpy(list[i],"");
}
for (i=0; i<=4 ; i++)
{
printf("%s\n",list[i]);
}
}
我想這是很紀念性的一刻 真的很妙ㄟ‥
留言列表