fork(2) download
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5. int i = 0, count = 0, count1 = 0;
  6. char a[] = "dppccddd";
  7. for (i = 0; i <= 6; i++)
  8. {
  9. if (a[i] == a[i + 1])
  10. count++;
  11. }
  12. printf("%d", count);
  13.  
  14. return 0;
  15. }
  16.  
Success #stdin #stdout 0s 2160KB
stdin
Standard input is empty
stdout
4