代码在VS2008下通过,要在附加依赖项中添加:opencv_core220d.lib opencv_highgui220d.lib opencv_imgproc220d.lib。也可以在代码里面添加以下内容:

#pragma comment(lib,"opencv_core220d.lib")
#pragma comment(lib,"opencv_highgui220d.lib")
#pragma comment(lib,"opencv_imgproc220d.lib")

还要配置好OpenCV环境,设置环境变量啊什么的。具体可见这篇文章:配置

Chapter 4:

1、Th is chapter completes our introduction to basic I/1. O programming and data structures in OpenCV. Th e following exercises build on this knowledge and create useful
utilities for later use.
a. Create a program that (1) reads frames from a video, (2) turns the result to grayscale,and (3) performs Canny edge detection on the image. Display all three stages of processing in three diff erent windows, with each window appropriately named for its function.
b. Display all three stages of processing in one image.
Hint: Create another image of the same height but three times the width as the video frame. Copy the images into this, either by using pointers or (more cleverly) by creating three new image headers that point to the beginning of and to one-third and two-thirds of the way into the imageData. Th en use cvCopy().

c. Write appropriate text labels describing the processing in each of the three slots.

a、Solution:

#include "opencv\cv.h"
#include "opencv\highgui.h"//Canny边缘检测算法
IplImage* doCanny(IplImage* in,double lowThresh,double highThresh,double aperture){if(in->nChannels != 1)return 0;IplImage* out = cvCreateImage(cvGetSize(in),IPL_DEPTH_8U,1);cvCanny(in,out,lowThresh,highThresh,aperture);return out;
}int main(){CvCapture* capture = cvCreateFileCapture("test.avi");//显示原始视频cvNamedWindow("window");//显示灰色视频cvNamedWindow("window_gray");//显示边缘检测之后的灰色视频cvNamedWindow("window_Canny");IplImage* frame;//************注意:要初始化!IplImage* frame_gray = cvCreateImage(cvSize((int)cvGetCaptureProperty(capture,CV_CAP_PROP_FRAME_WIDTH),(int)cvGetCaptureProperty(capture,CV_CAP_PROP_FRAME_HEIGHT)),IPL_DEPTH_8U,1);IplImage* frame_Canny = cvCreateImage(cvSize((int)cvGetCaptureProperty(capture,CV_CAP_PROP_FRAME_WIDTH),(int)cvGetCaptureProperty(capture,CV_CAP_PROP_FRAME_HEIGHT)),IPL_DEPTH_8U,1);while(1){frame = cvQueryFrame(capture);if(!frame){break;}//将彩色图像转化为灰色图像cvCvtColor(frame,frame_gray,CV_RGB2GRAY);frame_Canny = doCanny(frame_gray,10,100,3);cvShowImage("window",frame);cvShowImage("window_gray",frame_gray);cvShowImage("window_Canny",frame_Canny);if(cvWaitKey(33) == 27){//每秒显示30帧break;}}cvReleaseCapture(&capture);cvDestroyWindow("window");cvDestroyWindow("window_gray");cvDestroyWindow("window_Canny");
}

Test:

注意:在定义IplImage* frame_gray时,一定要记得用cvCreateImage初始化。否则会出现如下错误信息:

b+c、Solution:

#include "opencv\cv.h"
#include "opencv\highgui.h"//Canny边缘检测算法
IplImage* doCanny(IplImage* in,int lowThresh,int highThresh,int aperture){if(in->nChannels != 1)return 0;IplImage* out = cvCreateImage(cvGetSize(in),IPL_DEPTH_8U,1);cvCanny(in,out,lowThresh,highThresh,aperture);return out;
}int main(){CvCapture* capture = cvCreateFileCapture("test.avi");//把三个画面在一个窗口里面显示cvNamedWindow("window_all");//视频的每一帧IplImage* frame = NULL;frame = cvQueryFrame(capture);//视频帧图像的宽度和高度int width = (int)cvGetCaptureProperty(capture,CV_CAP_PROP_FRAME_WIDTH);int height = (int)cvGetCaptureProperty(capture,CV_CAP_PROP_FRAME_HEIGHT);//定义两种,是为了使三种图像的通道数一样,便于一起显示//单通道灰度图像IplImage* gray = cvCreateImage(cvSize(width, height),IPL_DEPTH_8U,1);//3通道灰度图像IplImage* frame_gray = cvCreateImage(cvSize(width, height),IPL_DEPTH_8U,3);//单通道Canny边缘检测图像IplImage* Canny = cvCreateImage(cvSize(width, height),IPL_DEPTH_8U,1);//3通道Canny边缘检测图像IplImage* frame_Canny = cvCreateImage(cvSize(width, height),IPL_DEPTH_8U,3);//把3张图像放在一起显示IplImage* frame_all = cvCreateImage(cvSize(width * 3,height),IPL_DEPTH_8U,frame ->nChannels);cvZero(frame_all);//定义三个图像头IplImage* img1 = cvCreateImageHeader(cvSize(width, height),frame ->depth,3);IplImage* img2 = cvCreateImageHeader(cvSize(width, height),frame ->depth,3);IplImage* img3 = cvCreateImageHeader(cvSize(width, height),frame ->depth,3);img1 ->origin = frame ->origin;img1 ->widthStep = frame_all ->widthStep;img1->depth = frame->depth;img1 ->nChannels = 3;img2 ->origin = frame ->origin;img2 ->widthStep = frame_all ->widthStep;img2->depth = frame->depth;img2 ->nChannels = 3;img3 ->origin = frame ->origin;img3 ->widthStep = frame_all ->widthStep;img3->depth = frame->depth;img3 ->nChannels = 3;while(1){frame = cvQueryFrame(capture);if(!frame){return 1;}//将彩色图像转化为灰色图像cvCvtColor(frame,gray,CV_RGB2GRAY);cvCvtColor(gray,frame_gray,CV_GRAY2BGR);Canny = doCanny(gray,10,100,3);cvCvtColor(Canny,frame_Canny,CV_GRAY2BGR);img1 ->imageData = frame_all ->imageData;cvCopy(frame,img1);img2 ->imageData = frame_all ->imageData + frame ->widthStep;cvCopy(frame_gray,img2);img3 ->imageData = frame_all ->imageData + 2 * frame ->widthStep;cvCopy(frame_Canny,img3);CvFont textfont = cvFont(10.0,1);cvInitFont(&textfont, CV_FONT_HERSHEY_SIMPLEX, 0.5f, 0.5f, 0, 1);cvPutText(frame_all, "Frame", cvPoint(10,20), &textfont, cvScalar(0,0,255));cvPutText(frame_all, "Frame_Gray", cvPoint(width+10,20), &textfont, cvScalar(255,0,0));cvPutText(frame_all, "Frame_Canny", cvPoint(width*2+10, 20), &textfont, cvScalar(0,255,0));cvShowImage("window_all",frame_all);if(cvWaitKey(33) == 27){//每秒显示30帧break;}}cvReleaseImage(&frame);cvReleaseImage(&gray);cvReleaseImage(&frame_gray);cvReleaseImage(&Canny);cvReleaseImage(&frame_Canny);cvReleaseImage(&img1);cvReleaseImage(&img2);cvReleaseImage(&img3);cvReleaseCapture(&capture);cvDestroyWindow("window_all");
}

Test:

2、 Create a program that reads in and displays an image. When the user’s mouse clicks on the image, read in the corresponding pixel (blue, green, red) values and write those values as text to the screen at the mouse location.

Solution:

#include "opencv\cv.h"
#include "opencv\highgui.h"
#include "stdio.h"
#include <iostream>using namespace std;char* str = (char*)malloc(30 * sizeof(char*));
bool draw = false;
CvPoint point;
CvFont font = cvFont(10.0,1);  void my_mouse_callback(int event,int x,int y,int flags,void* param){IplImage* img = (IplImage*)param;switch(event){case CV_EVENT_MOUSEMOVE:break;case CV_EVENT_LBUTTONDOWN:{draw = true;CvScalar pt = cvGet2D(img,y,x);double b = pt.val[0];double g = pt.val[1];double r = pt.val[2];memset(str,0,30);sprintf(str,"B:%.0f,G:%.0f,R:%.0f",b,g,r);cout<<"B:"<<b<<",G:"<<g<<",R:"<<r<<endl;point = cvPoint(x,y);cvInitFont(&font, CV_FONT_HERSHEY_SIMPLEX, 0.5f, 0.5f, 0, 1); }break;case CV_EVENT_LBUTTONUP:draw = false;break;}
}int main(){IplImage* img = cvLoadImage("HUST.jpg");cvNamedWindow("image");IplImage* temp = cvCloneImage(img);cvSetMouseCallback("image",my_mouse_callback,(void*)img);while(1){cvCopyImage(img,temp);if(draw){cvPutText(temp,str,point,&font,cvScalar(255,0,0));}cvShowImage("image",temp);if(cvWaitKey(30) == 27)break;}cvReleaseImage(&img);cvReleaseImage(&temp);cvDestroyWindow("image");
}

Test:

a. For the program of exercise 1b, display the mouse coordinates of the individual image when clicking anywhere within the three-image display.

Solution:

#include "opencv\cv.h"
#include "opencv\highgui.h"
#include <iostream>using namespace std;char* str = (char*)malloc(30 * sizeof(char*));
bool draw = false;
CvPoint point;
CvFont font = cvFont(10.0,1);  void my_mouse_callback(  int event,  int x,  int y,  int flags,  void* param){  IplImage* img = (IplImage*)param;  switch(event){  case CV_EVENT_MOUSEMOVE:  break;  case CV_EVENT_LBUTTONDOWN:{  draw = true;  memset(str,0,30);  sprintf(str,"x:%d,y:%d",x,y);  cout<<"x:"<<x<<",y:"<<y<<endl;  point = cvPoint(x,y);  cvInitFont(&font, CV_FONT_HERSHEY_SIMPLEX, 0.5f, 0.5f, 0, 1);   }  break;  case CV_EVENT_LBUTTONUP:  draw = false;  break;  }
}  //Canny边缘检测算法
IplImage* doCanny(IplImage* in,int lowThresh,int highThresh,int aperture){if(in->nChannels != 1)return 0;IplImage* out = cvCreateImage(cvGetSize(in),IPL_DEPTH_8U,1);cvCanny(in,out,lowThresh,highThresh,aperture);return out;
}int main(){CvCapture* capture = cvCreateFileCapture("test.avi");//把三个画面在一个窗口里面显示cvNamedWindow("window_all");//视频的每一帧IplImage* frame = NULL;frame = cvQueryFrame(capture);//视频帧图像的宽度和高度int width = (int)cvGetCaptureProperty(capture,CV_CAP_PROP_FRAME_WIDTH);int height = (int)cvGetCaptureProperty(capture,CV_CAP_PROP_FRAME_HEIGHT);//定义两种,是为了使三种图像的通道数一样,便于一起显示//单通道灰度图像IplImage* gray = cvCreateImage(cvSize(width, height),IPL_DEPTH_8U,1);//3通道灰度图像IplImage* frame_gray = cvCreateImage(cvSize(width, height),IPL_DEPTH_8U,3);//单通道Canny边缘检测图像IplImage* Canny = cvCreateImage(cvSize(width, height),IPL_DEPTH_8U,1);//3通道Canny边缘检测图像IplImage* frame_Canny = cvCreateImage(cvSize(width, height),IPL_DEPTH_8U,3);//把3张图像放在一起显示IplImage* frame_all = cvCreateImage(cvSize(width * 3,height),IPL_DEPTH_8U,frame ->nChannels);cvZero(frame_all);IplImage* temp = cvCloneImage(frame_all);  cvSetMouseCallback("window_all",my_mouse_callback,(void*)frame_all); //定义三个图像头IplImage* img1 = cvCreateImageHeader(cvSize(width, height),frame ->depth,3);IplImage* img2 = cvCreateImageHeader(cvSize(width, height),frame ->depth,3);IplImage* img3 = cvCreateImageHeader(cvSize(width, height),frame ->depth,3);img1 ->origin = frame ->origin;img1 ->widthStep = frame_all ->widthStep;img1->depth = frame->depth;img1 ->nChannels = 3;img2 ->origin = frame ->origin;img2 ->widthStep = frame_all ->widthStep;img2->depth = frame->depth;img2 ->nChannels = 3;img3 ->origin = frame ->origin;img3 ->widthStep = frame_all ->widthStep;img3->depth = frame->depth;img3 ->nChannels = 3;while(1){frame = cvQueryFrame(capture);if(!frame){return 1;}//将彩色图像转化为灰色图像cvCvtColor(frame,gray,CV_RGB2GRAY);cvCvtColor(gray,frame_gray,CV_GRAY2BGR);Canny = doCanny(gray,10,100,3);cvCvtColor(Canny,frame_Canny,CV_GRAY2BGR);img1 ->imageData = frame_all ->imageData;cvCopy(frame,img1);img2 ->imageData = frame_all ->imageData + frame ->widthStep;cvCopy(frame_gray,img2);img3 ->imageData = frame_all ->imageData + 2 * frame ->widthStep;cvCopy(frame_Canny,img3);CvFont textfont = cvFont(10.0,1);cvInitFont(&textfont, CV_FONT_HERSHEY_SIMPLEX, 0.5f, 0.5f, 0, 1);cvPutText(frame_all, "Frame", cvPoint(10,20), &textfont, cvScalar(0,0,255));cvPutText(frame_all, "Frame_Gray", cvPoint(width+10,20), &textfont, cvScalar(255,0,0));cvPutText(frame_all, "Frame_Canny", cvPoint(width*2+10, 20), &textfont, cvScalar(0,255,0));cvCopyImage(frame_all,temp);  if(draw){  cvPutText(temp,  str,  point,  &font,  cvScalar(0,0,255)  );  }  cvShowImage("window_all",temp);if(cvWaitKey(33) == 27){//每秒显示30帧return 0;}}cvReleaseImage(&temp);cvReleaseImage(&frame);cvReleaseImage(&gray);cvReleaseImage(&frame_gray);cvReleaseImage(&Canny);cvReleaseImage(&frame_Canny);cvReleaseImage(&img1);cvReleaseImage(&img2);cvReleaseImage(&img3);cvReleaseCapture(&capture);cvDestroyWindow("window_all");
}

Test:

3. Create a program that reads in and displays an image.
a. Allow the user to select a rectangular region in the image by drawing a rectangle with the mouse button held down, and highlight the region when the mouse button is released. Be careful to save an image copy in memory so that your drawing into the image does not destroy the original values there. Th e next mouse click should start the process all over again from the original image.

solution:

#include "opencv\cv.h"
#include "opencv\highgui.h"CvRect rect;//矩形框
bool draw = false;//标记画的状态void draw_rect(IplImage* img,CvRect rect){cvRectangle(img,cvPoint(rect.x,rect.y),cvPoint(rect.x + rect.width,rect.y + rect.height),cvScalar(0x00,0x00,0xff));
}void my_mouse_callback(int event,int x,int y,int flags,void* param){IplImage* img = (IplImage*)param;switch(event){case CV_EVENT_MOUSEMOVE:{if(draw){rect.width = x - rect.x;rect.height = y - rect.y;}                 }break;case CV_EVENT_LBUTTONDOWN:{draw = true;rect = cvRect(x,y,0,0);}break;case CV_EVENT_LBUTTONUP:{draw = false;if(rect.width < 0){rect.x += rect.width;rect.width *= -1;}if(rect.height < 0){rect.y += rect.height;rect.height *= -1;}draw_rect(img,rect);}break;}
}int main(){IplImage* img = cvLoadImage("HUST.jpg");rect = cvRect(-1,-1,0,0);cvNamedWindow("draw rect");//在内存保存副本IplImage* temp = cvCloneImage(img);cvSetMouseCallback("draw rect",my_mouse_callback,(void*)img);while(1){cvCopyImage(img,temp);if(draw){draw_rect(temp,rect);}cvShowImage("draw rect",temp);if(cvWaitKey(15) == 27)break;}cvReleaseImage(&img);cvReleaseImage(&temp);cvDestroyWindow("draw rect");
}

Test:

b. In a separate window, use the drawing functions to draw a graph in blue, green,and red for how many pixels of each value were found in the selected box. This is the color histogram of that color region. Th e x-axis should be eight bins that represent pixel values falling within the ranges 0–31, 32–63, . . ., 223–255. The y-axis should be counts of the number of pixels that were found in that bin range. Do this for each color channel, BGR.

solution:

#include "opencv\cv.h"
#include "opencv\highgui.h"CvRect rect;//矩形框
bool draw = false;//标记画矩形框的状态
bool draw_hist = false;//鼠标左键弹起开始画直方图//绘制直方图的函数
void draw_rect(IplImage* img,CvRect rect){cvSetImageROI(img,rect);IplImage* src= cvCreateImage(cvSize(rect.width,rect.height),IPL_DEPTH_8U,3);cvCopy(img,src);cvResetImageROI(img);IplImage* r_img = cvCreateImage(cvGetSize(src),IPL_DEPTH_8U,1);IplImage* g_img = cvCreateImage(cvGetSize(src),IPL_DEPTH_8U,1);IplImage* b_img = cvCreateImage(cvGetSize(src),IPL_DEPTH_8U,1);IplImage* gray_img = cvCreateImage(cvGetSize(src),IPL_DEPTH_8U,1);//分离R,G,B分量cvSplit(src,r_img,g_img,b_img,NULL);//灰度转换cvCvtColor(src,gray_img,CV_BGR2GRAY);int size = 256;float range[] = {0,255};float* ranges[] = {range};//创建直方图CvHistogram* r_hist = cvCreateHist(1,&size,CV_HIST_ARRAY,ranges,1);CvHistogram* g_hist = cvCreateHist(1,&size,CV_HIST_ARRAY,ranges,1);CvHistogram* b_hist = cvCreateHist(1,&size,CV_HIST_ARRAY,ranges,1);CvHistogram* gray_hist = cvCreateHist(1,&size,CV_HIST_ARRAY,ranges,1);//红色分量直方图cvCalcHist(&r_img,r_hist,0,NULL);IplImage* r_dst = cvCreateImage(cvSize(400,300),IPL_DEPTH_8U,3);cvSet(r_dst,cvScalarAll(255),0);float r_max = 0;cvGetMinMaxHistValue(r_hist,NULL,&r_max,NULL,NULL);double r_bin_width = (double)r_dst ->width / size;double r_bin_unith = (double)r_dst ->height / r_max;//高度比例for(int i = 0;i < size;++i){//获得矩形左上角和右下角坐标CvPoint p0 = cvPoint(i * r_bin_width,r_dst ->height);CvPoint p1 = cvPoint((i + 1) * r_bin_width,r_dst ->height - cvGetReal1D(r_hist ->bins,i) * r_bin_unith);cvRectangle(r_dst,p0,p1,cvScalar(255,0,0),-1,8,0);//-1表示画实心矩形}//绿色分量直方图cvCalcHist(&g_img,g_hist,0,NULL);IplImage* g_dst = cvCreateImage(cvSize(400,300),IPL_DEPTH_8U,3);cvSet(g_dst,cvScalarAll(255),0);float g_max = 0;cvGetMinMaxHistValue(g_hist,NULL,&g_max,NULL,NULL);double g_bin_width = (double)g_dst ->width / size;double g_bin_unith = (double)g_dst ->height / g_max;//高度比例for(int i = 0;i < size;++i){//获得矩形左上角和右下角坐标CvPoint p0 = cvPoint(i * g_bin_width,g_dst ->height);CvPoint p1 = cvPoint((i + 1) * g_bin_width,g_dst ->height - cvGetReal1D(g_hist ->bins,i) * g_bin_unith);cvRectangle(g_dst,p0,p1,cvScalar(0,255,0),-1,8,0);//-1表示画实心矩形}//蓝色分量直方图cvCalcHist(&b_img,b_hist,0,NULL);IplImage* b_dst = cvCreateImage(cvSize(400,300),IPL_DEPTH_8U,3);cvSet(b_dst,cvScalarAll(255),0);float b_max = 0;cvGetMinMaxHistValue(b_hist,NULL,&b_max,NULL,NULL);double b_bin_width = (double)b_dst ->width / size;double b_bin_unith = (double)b_dst ->height / b_max;//高度比例for(int i = 0;i < size;++i){//获得矩形左上角和右下角坐标CvPoint p0 = cvPoint(i * b_bin_width,b_dst ->height);CvPoint p1 = cvPoint((i + 1) * b_bin_width,b_dst ->height - cvGetReal1D(b_hist ->bins,i) * b_bin_unith);cvRectangle(b_dst,p0,p1,cvScalar(0,0,255),-1,8,0);//-1表示画实心矩形}//灰度图直方图cvCalcHist(&gray_img,gray_hist,0,NULL);IplImage* gray_dst = cvCreateImage(cvSize(400,300),IPL_DEPTH_8U,3);cvSet(gray_dst,cvScalarAll(255),0);float gray_max = 0;cvGetMinMaxHistValue(gray_hist,NULL,&gray_max,NULL,NULL);double gray_bin_width = (double)gray_dst ->width / size;double gray_bin_unith = (double)gray_dst ->height / gray_max;//高度比例for(int i = 0;i < size;++i){//获得矩形左上角和右下角坐标CvPoint p0 = cvPoint(i * gray_bin_width,gray_dst ->height);CvPoint p1 = cvPoint((i + 1) * gray_bin_width,gray_dst ->height - cvGetReal1D(gray_hist ->bins,i) * gray_bin_unith);cvRectangle(gray_dst,p0,p1,cvScalar(0),-1,8,0);//-1表示画实心矩形}//把四个直方图在一幅图片上显示出来IplImage* dst = cvCreateImage(cvSize(800,600),8,3);cvSetZero(dst);//拷贝红色分量直方图CvRect rect = cvRect(0,0,400,300);cvSetImageROI(dst,rect);cvCopy(r_dst,dst);//拷贝绿色分量直方图rect = cvRect(400,0,400,300);cvSetImageROI(dst,rect);cvCopy(g_dst,dst);//拷贝蓝色分量直方图rect = cvRect(0,300,400,300);cvSetImageROI(dst,rect);cvCopy(b_dst,dst);//拷贝灰度图分量直方图rect = cvRect(400,300,400,300);cvSetImageROI(dst,rect);cvCopy(gray_dst,dst);cvResetImageROI(dst);cvNamedWindow("src",1);cvShowImage("src",src);cvNamedWindow("dst",1);cvShowImage("dst",dst);cvSaveImage("dst.jpg",dst);cvWaitKey(0);cvDestroyAllWindows();cvReleaseImage(&r_img);cvReleaseImage(&g_img);cvReleaseImage(&b_img);cvReleaseImage(&gray_img);cvReleaseImage(&src);cvReleaseImage(&dst);cvReleaseImage(&r_dst);cvReleaseImage(&g_dst);cvReleaseImage(&b_dst);}//我的鼠标响应函数
void my_mouse_callback(int event,int x,int y,int flags,void* param){IplImage* img = (IplImage*)param;switch(event){case CV_EVENT_MOUSEMOVE:{if(draw){rect.width = x - rect.x;rect.height = y - rect.y;}draw_hist = false;}break;case CV_EVENT_LBUTTONDOWN:{draw = true;rect = cvRect(x,y,0,0);draw_hist = false;}break;case CV_EVENT_LBUTTONUP:{draw = false;draw_hist = true;if(rect.width < 0){rect.x += rect.width;rect.width *= -1;}if(rect.height < 0){rect.y += rect.height;rect.height *= -1;}draw_rect(img,rect);}break;}
}int main(){IplImage* img = cvLoadImage("HUST.jpg");rect = cvRect(-1,-1,0,0);cvNamedWindow("draw rect");//在内存保存副本IplImage* temp = cvCloneImage(img);cvSetMouseCallback("draw rect",my_mouse_callback,(void*)img);while(1){cvCopyImage(img,temp);if(draw_hist){draw_rect(temp,rect);}cvShowImage("draw rect",temp);if(cvWaitKey(15) == 27)break;}cvReleaseImage(&img);cvReleaseImage(&temp);cvDestroyWindow("draw rect");
}

Test:

《学习OpenCV》课后习题解答(第四章)(仅供参考)(不断更新)相关推荐

  1. 《学习OpenCV》课后习题解答(第三章)(仅供参考)

    代码在VS2008下通过,要在附加依赖项中添加:opencv_core220d.lib opencv_highgui220d.lib opencv_imgproc220d.lib. 也可以在代码里面添 ...

  2. python教材答案第四章_python核心编程课后习题解答第四章

    4–1. Python 对象.与所有Python 对象有关的三个属性是什么?请简单的描述一下. type.ID.value..(身份.类型.值) type()接受一个对象作为参数,并返回它的类型 id ...

  3. JAVA大学实用教程(第四版)课后习题三、四章答案(自整理)

    第三章 1.下列System.out.printf输出的结果是什么? int a=100, x,y; x=++a; y=a-- System.out.printf("%d, %d,%d&qu ...

  4. 《C语言的科学与艺术》课后习题答案第四章(部分)

    自看着本书以来,一直没有在网上找到这本书的课后习题答案,所以把自己写的贴出来方便与大家交流,有不准确的地方,望大家批评指正... 4.3://读取输入的N值,计算前N项奇数的和,如N=4,则输出16( ...

  5. Oracle 11g数据库基础教程(第2版)-课后习题-第十四章

    --第十四章 --1.对HUMAN_RESOURCE数据库进行冷备份--1.启动sqlplus,以sysdba身份登录数据库--2.查询当前数据库所有数据文件.控制文件.联机重做日志文件的位置sele ...

  6. 计算机网络谢希仁第七版课后习题答案(第四章)

    4-1 网络层向上提供的服务有哪两种?是比较其优缺点. 网络层向运输层提供 "面向连接"虚电路(Virtual Circuit)服务或"无连接"数据报服务前者预 ...

  7. 快学Scala习题解答—第四章 映射和元组

    4 映射和元组 4.1 设置一个映射,当中包括你想要的一些装备,以及它们的价格.然后构建还有一个映射.採用同一组键,可是价格上打9折  映射的简单操作 Shell代码   scala> val  ...

  8. 电路习题解答 第四章 4-25

    戴维南等效电路和诺顿等效电路,总体上核心思想就是求开路电压和等效电阻. 开路电压Uoc求解: 使用KCL.KVL.VCR.节点电压法,一般就能够求出来. 等效电阻Req求解: 1.对于没有受控源的电路 ...

  9. 算法导论课后习题解析 第四章 上

    4.1-1 返回只包含绝对值最小的元素的子数组. 4.1-2 Maximun-Subarray(A)max = -infinityfor i = 1 to A.lengthsum = 0for j = ...

最新文章

  1. 多目标跟踪(MOT)入门
  2. DNA提取方法对浮游生物群落研究结果的影响
  3. Thinkphp怎样修改模板标签定界符
  4. android+ip+rule+策略路由,策略路由以及使用 ip route , ip rule , iptables 配置策略路由实例...
  5. oracle schema_oracle数据库全局统计更新
  6. 银行核心系统之应用集成
  7. Git for windows 配置
  8. 少样本学习系列(三)【Optimization-Based Methods】
  9. python连接mysql数据库简单例子
  10. php i方法和get的区别,浅析PHP中的i++与++i的区别及效率
  11. 蓝桥杯 算法提高 一元三次方程求解
  12. MATLAB绘制三维地图
  13. 1487: [HNOI2009]无归岛
  14. 基于单片机的超声波测距仪的设计
  15. WP7 SDK模拟器对应PC键盘的功能键
  16. 微信公众号二维码怎么生成?好用的生成方法介绍
  17. 去掉字符串头尾指定字符
  18. github软件---百度网盘加速
  19. i7 10700和10700f 10700k这三个CPU有什么区别
  20. k8s开启IPVS模式

热门文章

  1. 浅谈Opencl四大模型之Platform model
  2. jQuery UI基础 学习笔记
  3. html有几个文件夹,关于webpack打包问题,怎么打包成多个文件夹,每个文件夹下有相应的html,js和css?...
  4. matplotlib设置画布大小_PyTorch 49.matplotlib模块
  5. phpcmsV9视频模块插件 - 手把手开发教程
  6. python编写程序输入整数n求n_Python入门习题----N=ABXBA
  7. 西工大18秋《C语言程序设计》平时作业,西工大18秋《C语言程序设计》平时作业(100分)...
  8. video js 全屏时,遇到18:9的长屏幕时,画面被切割
  9. PHP在线SEO文章伪原创同义词交换工具源码
  10. GoEasy小程序即时通讯源码 v1.1.0基于GoEasy提供的websocket通讯服务