1. 1 #include 2 3 #define SPACE ' ' 4 #define NEWLINE '\n' 5 6 int main() 7 { 8 int spaces,newlines,others; 9 char ch;10 spaces = newli...
分类:
其他好文 时间:
2014-07-16 20:18:33
阅读次数:
139
算法实现题 8-9 方格取数问题(习题 8-20)?问题描述:在一个有 m*n 个方格的棋盘中,每个方格中有一个正整数。现要从方格中取数,使任意 2 个数所在方格没有公共边,且取出的数的总和最大。试设计一个满足要求的取数算法。?编程任务:对于给定的方格棋盘,按照取数要求编程找出总和最大的数。?数据输...
分类:
其他好文 时间:
2014-07-16 19:24:45
阅读次数:
203
算法实现题 8-10 餐巾计划问题(习题 8-21)?问题描述:一个餐厅在相继的 N 天里,每天需用的餐巾数不尽相同。假设第 i 天需要 ri块餐巾(i=1,2,…,N)。餐厅可以购买新的餐巾,每块餐巾的费用为 p 分;或者把旧餐巾送到快洗部,洗一块需 m 天,其费用为 f 分;或者送到慢洗部,洗一...
分类:
其他好文 时间:
2014-07-15 10:02:06
阅读次数:
202
一:通过JavaScript的方式设置样式(:拿习题为例): var shuiguo = document.getElementById('fruit'); shuiguo.style.backgroundColor = 'Red'; //1 shuiguo.onclick = function (...
分类:
编程语言 时间:
2014-07-15 00:32:00
阅读次数:
323
有一定的难度,作者只做了前三题!
题目请见 http://download.csdn.net/download/wangpegasus/5701765
1、char *find_char(char const *source, char const *chars)
{
char *ptr;
if(source != NULL && chars != NULL)
{
for (; ...
分类:
其他好文 时间:
2014-07-14 18:16:35
阅读次数:
289
这是练习题,没啥难度,留作纪念,记录下来 1 #include 2 using namespace std; 3 int main() 4 { 5 int number; 6 7 for (int i = 0; ; i++) 8 { 9 if (i%3 =...
分类:
其他好文 时间:
2014-07-13 22:40:44
阅读次数:
296
题目请见 http://download.csdn.net/download/wangpegasus/5701765
第四章以下通过VS2012
1、
#include "stdafx.h"
#include
double sqrt(double temp)
{
double before, after;
before = 1.0;
after = 1.0;
do
{...
分类:
其他好文 时间:
2014-07-12 23:19:41
阅读次数:
225
实验室有要做阶段练习题了,其中有一道改bug题:#include
#include
int main(int, char**)
{
std::vector** ppRandomData = distributeRandomInt(100);
for (unsigned int i=0; i<1000; i++)
{
if (ppRandomData[i])
{
std:...
分类:
其他好文 时间:
2014-07-12 19:46:35
阅读次数:
223