Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- int fun(char *napis)
- {
- char * wynik = (char*)malloc(sizeof(char)*255);
- int i,licznik=0;
- wynik=napis;
- for(i=0; wynik[i]!='\0'; i++){
- if(wynik[i]>='A' && wynik[i]<='Z'){
- wynik[i]=wynik[i]^32;
- }
- }
- for(i=0;wynik[i+1]!='\0';i++)
- if(wynik[i]==wynik[i+1])
- licznik++;
- return licznik;
- }
- int main()
- {
- int i;
- printf("%d",fun("aaaa"));
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment