编程思想
chenpeng36
这个作者很懒,什么都没留下…
展开
-
branch prediction
在stackoverflow看到的一篇文章 http://stackoverflow.com/questions/11227809/why-is-processing-a-sorted-array-faster-than-an-unsorted-array 排序后竟然比不排序的速度更快,排序后快了几乎两倍的时间。很惊奇 #include #include #include i转载 2015-04-21 11:26:37 · 534 阅读 · 0 评论 -
字符串中 区分中文字符还是英文字符
英文字符ASCII是在0到127之间的,而汉字的两个字节的ascii值都不在这个区间。 int main() { char s[] ="asfdfasf今天天气jfdsf可真热"; for (int i = 0; i < strlen(s); i++) if (s[i] > 0) std::cout<<s[i];//<<std::ends; else i++; ret原创 2015-04-17 11:02:03 · 1703 阅读 · 0 评论