MXX师兄里插播的一个问题...
实在是想不到, 上CSDN问了下, tailzhou 给了一个代码.
我就不描述了...直接上代码.
实在是想不到, 上CSDN问了下, tailzhou 给了一个代码.
我就不描述了...直接上代码.
- #include <stdio.h>
- int main()
- {
- char str[]="asdssfas efsdsdss";
- int j=1;
- int n=sizeof(str)/sizeof(char);
- int idx=0;
- int count=1;
- while(j <n-1)
- {
- if (str[idx]!=str[j]) count--;
- else count++;
- if (count==0)
- {
- idx=j+1;
- j++;
- count=1;
- }
- j++ ;
- }
- printf("%c",str[idx]);
- }