Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int func(char *arr)
- {
- int liczba=0;
- int dlugosc;
- dlugosc = strlen(arr);
- for (int i = 0; i < dlugosc-1; i++)
- {
- if (arr[i] >= 65 && arr[i] <= 90 || arr[i] >= 97 && arr[i] <= 122)
- {
- if (arr[i] == arr[i + 1] || arr[i] == (arr[i + 1] - 32) || arr[i] == arr[i + 1] + 32)
- {
- liczba += 1;
- }
- }
- else
- {
- if (arr[i] == arr[i + 1])
- {
- liczba += 1;
- }
- }
- }
- return liczba;
- }
- void kolos1()
- {
- char arr[]="aaBbcc111";
- printf("%d", func(arr));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement