Created
December 14, 2016 06:08
-
-
Save behitek/13c2adccb68abaf9b6bc76c034b63dfb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <string.h> | |
void nhap(char c[]){ | |
char ch; | |
int i = 0; | |
do{ | |
scanf("%c",&ch); | |
if(ch != 'k'){ | |
c[i] = ch; | |
i++; | |
} | |
}while(ch != 'k'); | |
} | |
void in(char c[]){ | |
printf("%s",c); | |
} | |
void dem(char c[]){ | |
int l = strlen(c); | |
int dem = 0; | |
for(int i = 0;i < l;i++){ | |
if(c[i] == 'c') dem++; | |
} | |
printf("\nSo ky tu c trong chuoi: %d",dem); | |
} | |
void chen(char c[]){ | |
c[strlen(c)] = 'z'; | |
printf("\nChuoi sau khi chen: "); | |
in(c); | |
} | |
int main(){ | |
char c[1000]; | |
nhap(c); | |
in(c); | |
dem(c); | |
chen(c); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment