练习:strncmp

#include <stdio.h>
#include <string.h>
int main(void)
{
 char min[32] = "love";
 char mic[32];
 int ad;
 
 printf("请输入:");
 
 fgets(mic,sizeof(mic),stdin);
 
 ad = strncmp(min,mic,strlen(min));
 
 printf("输出结果:%d\n",ad);
 
 return 0;
}

posted @ 2019-01-14 13:28  指遥  阅读(167)  评论(0编辑  收藏  举报