Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Dem ki tu xuat hien bao nhieu lan trong chuoi
- // Khai bao cac ham thu vien neu co
- //
- #include<stdio.h>
- #include<conio.h>
- #include<string.h>
- #define SIZE 100
- void main()
- {
- char S[SIZE];
- char b;
- gets(S);
- scanf("%c",&b);
- int n=strlen(S);
- int dem=0;
- for(int i=0;i<n-1;i++)
- {
- if(S[i]==b)
- dem++;
- }
- printf("%d",dem);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement