2013年11月28日

摘要: 今天一同学问我一道数学题,要用代码求出结果。题目如下图:我感觉题目的主要要处理的地方就是变量,有点多。下面是我写的代码,采用暴力方式寻找alpha,很臃肿。这些是用到的一些数据,名字和题目中对应,都是全局变量。本来没这么多,后来写着写着发现参数传来传去把我搞晕了,索性都全局了。1 #define PI 3.14159262 double D=860,LC=3200,d=430,b=5,LE=330;3 double a;//a(alpha)4 int n,N;下面是求解题目中第一个式子,这个很好处理:1 float res_t(void)2 {3 float temp;4 te... 阅读全文
posted @ 2013-11-28 14:42 水蛋壳 阅读(224) 评论(0) 推荐(0)

2013年11月22日

摘要: 这两天看书发现了一些小细节,以前没注意到,列举出来:1.关于bool型bool b = 12;int a = b;现在将a输出,发现它的值是1,相应b也是1.书上解释如下 “When we assign one of the nonbool arithmetic types to a bool object, the result is false if the value is 0 and true otherwise.”2.关于unsigned型用下面的代码测试#includeusing namespace std;int main(){ unsigned char c = -1; ... 阅读全文
posted @ 2013-11-22 22:52 水蛋壳 阅读(215) 评论(0) 推荐(0)

2013年11月16日

摘要: 今天看C++ Primer读到关于char的介绍时发现和我之前认识的不一样。书上原文这样:"Unlike the other integer types, there are three distinct basic character types: char, signed char and unsigned char. Inparticular, char is not the same type as signed char. Although there are three character types, there are only two representations 阅读全文
posted @ 2013-11-16 14:59 水蛋壳 阅读(2368) 评论(0) 推荐(0)

2013年11月15日

摘要: 审核的大大们给我通过博客申请了,非常感谢。。买了本C++ Primer,打算学习C++了。学习好忙,一定挤时间好好学习,这里也作为鞭策自己的一个地方吧。 阅读全文
posted @ 2013-11-15 21:21 水蛋壳 阅读(140) 评论(0) 推荐(0)