输入代码:
/*
* Copyright (c) 2015, 烟台大学计算机学院
* All rights reserved.
* 文件名称:sum123.cpp
* 作 者:林海云
* 完成日期:2015年4月26日
* 版 本 号:v2.0
*
* 问题描述: 阅读教材例10.1。该例实现了一个复数类,但是美中不足的是,复数类的实部和虚部都固定只能是do...
分类:
其他好文 时间:
2015-04-26 18:25:09
阅读次数:
157
一、设计思想 思路与寻找一个水王相似,这次只是计数器和嫌疑人变量都设置为数组。每次选取一个ID与三个嫌疑人比较,若有相同则计数;若三个都不相同,则三个计数器都减一。若减为0,则从新赋值给嫌疑人。二、源代码 1 // 水桶.cpp : Defines the entry point for the c...
分类:
编程语言 时间:
2015-04-26 18:20:29
阅读次数:
159
题目:You are climbing a stair case. It takesnsteps to reach to the top.Each time you can either climb 1 or 2 steps. In how many distinct ways can you cl...
分类:
其他好文 时间:
2015-04-26 18:17:40
阅读次数:
92
题目:You are given annxn2D matrix representing an image.Rotate the image by 90 degrees (clockwise).Follow up:Could you do this in-place?代码:class Solutio...
分类:
其他好文 时间:
2015-04-26 18:03:09
阅读次数:
99
题目:Given a non-negative number represented as an array of digits, plus one to the number.The digits are stored such that the most significant digit is...
分类:
其他好文 时间:
2015-04-26 17:59:43
阅读次数:
116
流行的strcpy函数写法是:[cpp]view plaincopychar*my_strcpy(char*dst,constchar*src){assert(dst!=NULL);assert(src!=NULL);char*ret=dst;while((*dst++=*src++)!='\0')...
分类:
其他好文 时间:
2015-04-26 16:33:34
阅读次数:
147
编译器内置宏:先介绍几个编译器内置的宏定义,这些宏定义不仅可以帮助我们完成跨平台的源码编写,灵活使用也可以巧妙地帮我们输出非常有用的调试信息。ANSI C标准中有几个标准预定义宏(也是常用的):__LINE__:在源代码中插入当前源代码行号;__FILE__:在源文件中插入当前源文件名;__DATE...
分类:
编程语言 时间:
2015-04-26 12:13:32
阅读次数:
140
题目:Givennnon-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining...
分类:
移动开发 时间:
2015-04-26 10:49:01
阅读次数:
135
For Debian7
1.从官网下载cocos2d-x-3.5,解压后按照README.md,依次setup.py和download所需库
2.然后编译test下的cpp-test工程 ,遇到问题有如下:
1)FindGLEW.cmake
意思是说没有FindGLEW.cmake,我也不知道为何没有……
解决方案如下:
在cmake/Modules下新建文件FindGL...
分类:
系统相关 时间:
2015-04-25 18:21:34
阅读次数:
320
首先是main.cpp让我们来看看都有什么函数
#include
#include"SeqList.h"
using namespace std;
int main()
{
SeqList mylist;
InitSeqList(&mylist);
int select = 1;
ElemType item = 0;
ElemType pos...
分类:
其他好文 时间:
2015-04-25 16:45:44
阅读次数:
139