其他
黑眼圈的意志
自我学习的地方
展开
-
自己编的猜数字小游戏
自己撸了半个小时的代码采编出来的一点点东西。。。 输入考虑不足,当输入字符时,就会崩溃。。。 #include #include #include using namespace std; typedef struct model{ int num[4] = {0,0,0,0}; int answer[4] = {0,0,0,0}; int flag; }model;原创 2013-11-21 20:50:28 · 992 阅读 · 0 评论 -
十进制数转二进制数
C++代码实现: #include #include #include #include #include using namespace std; int main() { ifstream in("abc.txt"); for (string a ;in>>a&&a!="-1";) { vector last; int x=0;原创 2013-12-08 21:53:14 · 631 阅读 · 0 评论 -
二进制数转十进制数
C++代码实现: #include #include #include #include using namespace std; int main() { ifstream in("abc.txt"); for (string a ;in>>a&&a!="-1";) { double x=0; int t=a.length();原创 2013-12-08 21:54:03 · 574 阅读 · 0 评论 -
人人code,整数取反
题目很简单,完成函数reverse,要求实现把给定的一个整数取其相反数的功能,举两个例子如下: x = 123, return 321 x = -123, return -321 #include #include #include using namespace std; vector c; void reverse(int); int main() { int n; c原创 2013-12-28 07:43:48 · 502 阅读 · 0 评论 -
八皇后(还有待改进)
呃,实习开始了。由于当初选错方向的问题,无奈实习只能跟着中软(中软国际)学做网站项目。不太喜欢JAVA,但并不是说JAVA不好,前几天看的一个位操作,那个用JAVA的人写的代码也挺精湛的。 不扯废话,上午没事,就想着写了个N皇后问题的代码。上午卡在了斜线的处理上,卡了两个小时。。。汗~!结果回去睡了个午觉,再调的时候没几分钟就弄好了。。。 我个人感觉代码还有待改进,先把思路记录下。 整体思路原创 2014-01-11 13:46:42 · 754 阅读 · 0 评论