统计1字符串在另1个字符串中出现的次数.docxVIP

  • 15
  • 0
  • 约1.55千字
  • 约 2页
  • 2017-05-19 发布于四川
  • 举报

统计1字符串在另1个字符串中出现的次数.docx

统计1字符串在另1个字符串中出现的次数

#include stdio.h #include string.h #include conio.h int findStr(char *str, char *substr) { int n; char *p, *r; n = 0; while (*str) { p = str; r = substr; while (*r) if (*r == *p) { r++; p++; } else { break; } if (*r == \0) n++; str++; } return n; } void ReadWrite() { char str[81], substr[10], ch; int n, len, i = 0; FILE *rf, *wf; rf = fopen(in.dat, r); wf = fopen(out.dat,

文档评论(0)

1亿VIP精品文档

相关文档