Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<math.h>
- int slova2puta (char *s) {
- int slova[30]={0};
- while (*s!='\0') {
- if (*s>='a' && *s<='z') slova[*s-'a']++;
- if (*s>='A' && *s<='Z') slova[*s-'A']++;
- s++;
- }
- int br_dva_slova=0,j;
- for (j=0; j<30; j++) {
- if (slova[j]==2) br_dva_slova++;
- }
- return br_dva_slova;
- }
- int main () {
- char s[]="123seslmma";
- printf("%d",slova2puta(s));
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement