摘要: Write a program to: 1) wait for the user to input a positive integer N, and 2) output a NxN matrix on the screen with numbers 1 to N, rotating clockwise inward. 阅读全文
posted @ 2015-06-28 21:23 cwss 阅读(223) 评论(0) 推荐(0) 编辑
摘要: 好吧,不得不说Professor Demko的C++ for FE 的project真是可以加速学习C++的好方法。当年本科时候在李文新老师的课上学C++最后也只是完成了POJ上《魔兽世界》的大作业,而且只考虑了下派生类、友类和虚构函数。其他东西,呵呵,早都忘了噜。好了,废话不多说,开始讨论问题。在 terminal中用g++编译C++文件,遇到两个主要的问题,中文网页中很少有所讨论。卤煮在stackoverflow上倒是看到了不少这样的讨论,果然程序员的英文水平都很高>w 7 #include 8 9 const double PI = 3.1415926;10 11 class My 阅读全文
posted @ 2013-10-05 11:52 cwss 阅读(2725) 评论(2) 推荐(0) 编辑
摘要: 第一次写python,真是蛇年学python的节奏。在本程序中想进行如下一个循环,并在最后一层中进行一个if判断:当ini_allocation中得元素之和为1时进行下面的part。 1 for i in range(0,11): 2 ini_allocation[1] = 0.0 3 4 for j in range(0,11): 5 ini_allocation[2] = 0.0 6 7 for k in range(0,11): 8 ini_allocation[3] = 0.0 9 10 ... 阅读全文
posted @ 2013-09-16 12:30 cwss 阅读(24801) 评论(0) 推荐(0) 编辑
摘要: 因为要完成一个将csv文件读入并分析其中数据的作业,不得不用到getline函数。getline函数是中的函数,用于对输入文件进行读取,并写入相关的变量中。我就把这次作业的程序段贴在这里来帮助我下次回忆如何用getline函数的说。似乎函数的内容是这样的,getline(*ifstream, string, char)。第一个是输入的文件流,也就是之前的ifstream;第二个是一个string类的字符串,第三个是截止字符。这样写得话,getline就会自动截取该字符前的字符串,正如65行中,我就采用','作为我的截止符号。getline(*ifstream, string)在 阅读全文
posted @ 2013-09-04 12:20 cwss 阅读(917) 评论(1) 推荐(0) 编辑
摘要: matlab遇到报错可能的情况 ??? Error using ==> vertcat CAT arguments dimensions are not consistent. 阅读全文
posted @ 2012-12-09 00:00 cwss 阅读(420) 评论(0) 推荐(0) 编辑