猜猜运行出来是啥?总是运行最内括号的,printf("%d",i)所以先输出43,由于printf()函数值是输出了多少位,所以紧接着输出了2,同样的,输出了2是1位,所以最外一层紧接着输出了1,最后就是4321
#include<stdio.h>
#include<stdlib.h>
int main()
{
int m = 43;
printf("%d\n", printf("%d", printf("%d", m)));
system("pause");
return 0;
}我的strstr:在一个字符串中找一个子字符串
//#include<stdio.h>
//#include<string.h>
//#include<stdlib.h>
//#include<assert.h>
//char *my_strstr(const char *ps, const char *pt)
//{
// int s = strlen(ps);
// int t = strlen(pt);
// int i = 0;
// int j = 0;
// assert(ps&&pt);
// while (*ps != ‘\0‘)
// {
// if(ps[i] == pt[j])
// {
// i++;
// j++;
// }
// else
// {
// i = i - j + 1;
// j= 0;
// }
// if (t == j)
// break;
// }
// return ps+i-j;
//}
//int main()
//{
// char *psource = "abcdefggg";
// char *ptarget = "efg";
// char *p = my_strstr(psource, ptarget);
// printf("%s\n", p);
// system("pause");
// return 0;
//}本文出自 “小止” 博客,请务必保留此出处http://10541556.blog.51cto.com/10531556/1696284
原文:http://10541556.blog.51cto.com/10531556/1696284