#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
int main()
{
unsigned long long max=3000000000000000000;
char buffer[max];
……继续阅读 »
9年前 (2016-04-18) 1113浏览
0个赞
一直没写出来,求高手!
解决方案
40
///最快可能时间为 :t0 =Sum(Si/(Vi+dv));
///最慢可能时间为:tm =Sum(Si/Vi)
当 t0<= t 的时候,最快时间为 t0
当 t0 > t 的时候,t 用完,也不能过全部传送带
此时
/// T= (tm-t) -Sum(ti*dV/Vi);
/// 条件是 ……继续阅读 »
9年前 (2016-04-18) 1602浏览
0个赞
main函数是要求整数N的单峰回文数。
原因是结果溢出long int,所以本人构造了一个BigInt大整数类,来存放结果。
BigInt类里面重载了+,=,<<.
原因是程序的要求是输入为0时结束,所以main函数最后是输入为0时,return 0.
但是这个return就是return不了,其他都没问题。本人再return前面加了一个输出Lo……继续阅读 »
9年前 (2016-04-18) 3571浏览
0个赞
各位高手,本人使用eigen矩阵库写如下代码使用动态矩阵库,老是出错
Matrix<double,Dynamic,1> GT;
GT(0,0)=a1;
给它元素赋值报错,是什么地方出错了吗?
求高手们给一个正确用法,定义矩阵时列数确定,行数不定
谢谢各位啦
解决方案
40
看一下Matrix类提供的接口,看那个可以实现这个功能。个人理解你定义的G……继续阅读 »
9年前 (2016-04-18) 3809浏览
0个赞
c++新手:怎么将视频中的图片存到内存的堆中?
求思路,谢谢大家
解决方案
20
可以试试opencv的imencode函数
10
#include <iostream>
#include <vector>
#include <string>
#include <opencv2\core\core.hpp>
……继续阅读 »
9年前 (2016-04-18) 1283浏览
0个赞
#include “stdafx.h”
#include <process.h>
extern “C”
{
#include “lua.h”
#include “lualib.h”
#include “lauxlib.h”
}……继续阅读 »
9年前 (2016-04-18) 1412浏览
0个赞
代码 initializer_list<int> a = { 10, 11, 12 }; 可以编译通过。
本人想 怎么样本人实现 CMyClass<int> a = { 10, 11, 12 }; 也可以编译通过。
参考了 initializer_list的实现,拷贝代码 CMyClass却没法实现这样的语句: CMyClass<……继续阅读 »
9年前 (2016-04-18) 1171浏览
0个赞
Modern Effective C++这本书上讲到:
template<class T>
void f(T t){}
int main(){
f({1,2,3});
}
这样的代码是编译不过的,原因是模板参数T在模板实例化的时候必须是已知类型,而{1,2,3}是个braced-init-list,
除非本人先auto x={1,2,3……继续阅读 »
9年前 (2016-04-18) 946浏览
0个赞
template <class T>
void mysort (T *const array ,int from ,int to) {
if (from >= to)
return ;
int i = from ;
int j = to ;
T tmp = std::move (array[i]) ;
while (true……继续阅读 »
9年前 (2016-04-18) 1073浏览
0个赞