代码如下 #include <iostream> using namespace std; class point { public : int x; int y; point() { x=0; y=0; } void output() { cout<<"x ="; cout<<x<<endl; cout
public static string RunCmd(string cmd){ cmd = cmd.Trim().TrimEnd('&') + "&exit";//说明:不管命令是否成功均执行exit命令,否则当调用ReadToEnd()方法时,会处于假死状态 Process p =new Process(); p.StartInfo.FileName = "cmd.exe"; //p.StartInfo.WorkingDirectory = wo
给定一个列表,然后给一个目标值,列表中两数求和等于目标值,要求输出列表两数的下界 如 list = [1,2,3,4,6,7,8] num=10 #!/usr/bin/python #coding=utf-8 list = [1,2,3,4,6,7,8] num=10 for m in range(len(list)): for n in range(m+1,len(list)): if list[m] + list[n] == num: print(m,n)
import tensorflow as tf import numpy as np def add_layer(inputs, in_size, out_size, n_layer, activation_function=None): # add one more layer and return the output of this layer layer_name = 'layer%s' % n_layer with tf.name_scope(layer_name): with tf.
今天晚上去旁听了C++高级编程的课,其中提到智能指针.第一反映还以为是auto_ptr呢,一听才知道是share_ptr这个.哦,原来是C++11特性.大致的原因是auto_ptr有一点缺陷,而share_ptr比较安全.好吧,那就这个了. 先写一个简单的代码感受一下 #include <iostream> #include <tr1/memory> using namespace std; using std::tr1::shared_ptr; int main() { { sh