标签:for highlight can ++i fgets class sha div return
#include <stdio.h> int main(){ char str[100],ch,M,Empty; int i, frequency = 0; fgets(str, (sizeof str / sizeof str[0]), stdin); scanf("%c",&ch); scanf("%c",&M); scanf("%c",&Empty); for(i = 0; str[i] != ‘\0‘; ++i) { if(ch == str[i]) ++frequency; } printf("字符 %c 在字符串中出现的次数为 %d\n", ch, frequency); return 0; }
标签:for highlight can ++i fgets class sha div return
原文地址:https://www.cnblogs.com/todarcy/p/11116290.html