![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C
zhouyelihua
昨夜星辰昨夜风
展开
-
OBJ文件读取
OBJ文件读取 代码只是存储一下,不然每次翻电脑找代码很麻烦 void readObjFile(std::string filename, std::vector<std::array<float, 3> >&pts, std::vector<std::array<int, 3> >&facets) { pts.clear(); facets.clear(); std::fstream pointCouldStream; pointCo原创 2020-12-25 10:34:05 · 1671 阅读 · 0 评论 -
一道简单的ACM题目讨论
准备考研了!但是发现自己的编程很不规范! 下面是杭州电子科技大学的一道acm Problem Description Hey, welcome to HDOJ(Hangzhou Dianzi University Online Judge). In this problem, your task is to calculate SUM(n) = 1 + 2 + 3 + ... + n.原创 2012-04-13 00:06:26 · 1261 阅读 · 2 评论 -
怎样消除goto语句
// 今天心情好差啊!暗恋已经暗恋6年的女孩了!而且今天感冒了一直咳嗽!注意:大家感冒吃枇杷露时候一定不能吃红枣的!// goto 语句可以灵活跳转,如果不加限制,它的确会破坏结构化设计风格。其次,goto 语句经常带来错误或隐患。 其实在linux编程中goto语句还是经常会使用到的很方便!特别是自己编写的一些小程序中。 你可以很轻松的 在网上找到这样的消除goto的示例! if(co原创 2012-04-02 22:44:21 · 3605 阅读 · 4 评论 -
#define的其他用法
转载自: 最近看com相关的资料,看到CCmdTarget实现com接口的时候,去读了一些宏的定义,在afxdisp.h头文件中 #define BEGIN_INTERFACE_PART(localClass, baseClass) \ class X##localClass : public baseClass \ 本来这个宏定义很容易理解的,但是这里多出个X##,我转载 2014-09-01 22:47:44 · 677 阅读 · 0 评论 -
C++堆和栈区别
转载:http://blog.csdn.net/nieyibin/article/details/7468323(但是网址好像也是转载的) C++中堆和栈的区别,自由存储区、全局/静态存储区和常量存储区 文章来自一个论坛里的回帖,哪个论坛记不得了! 在C++中,内存分成5个区,他们分别是堆、栈、自由存储区、全局/静态 存储区和常量存储区。 栈,就是那些由编译器在需要的时候分配,在不转载 2015-07-09 23:32:15 · 602 阅读 · 0 评论 -
最优化程序c++的方法
解决的问题最优化问题的一般形式 minf(paras)min \quad f(paras)s.t.paras∈[paras_lower,paras_upper]s.t. \quad paras\in[paras\_lower,paras\_upper] 这个是数学上的一般形式,当求函数的最大值时候只要加上一个负号就可以 在程序中我们面对的问题一般是离散的即原创 2015-08-27 01:53:50 · 4972 阅读 · 0 评论 -
Large sum--projecteuler
题目来自于:https://projecteuler.net/problem=13 Large sum Problem 13 Work out the first ten digits of the sum of the following one-hundred 50-digit numbers. 371072875339021027987979982208375902465101原创 2016-08-20 19:33:24 · 510 阅读 · 0 评论