超难的75道逻辑思维题

超难的75道逻辑思维题2010-03-28 19:41:30*【1】假设有一个池塘,里面有无穷多的水。现有2个空水壶,容积分别为5升和6升。问题是如何只用这2个水壶从池塘里取得3升的水。 【2】周雯的妈妈是豫林水泥厂的化验员。 一天,周雯来到化验室做作业。做完后想出去玩。 "等等,妈妈还要考你一个题目,"她接着说,"你看这6只做化验用的玻璃杯,前面3只盛满了水,后面3只是空的。你 能只移动1只玻璃杯,就便盛满水的杯子和空杯子间隔起来吗?" 爱动脑筋的周雯,是学校里有名的"小机灵",她只想了一会儿就做到了。 请你想想看,"小机灵"是怎样做的? 【3】三个小伙子同时爱上了一 个姑娘,为了...
A13433758072 发布于 2011-10-15 09:56 | 阅读 1073 次 | 评论 0 条

感谢

很高兴和大家在论谈中学习!
一名菜鸟 发布于 2011-10-15 08:58 | 阅读 629 次 | 评论 0 条

新手,不熟悉路啊

还不熟悉这个啊!哪位好心的帮帮忙,指点指点。
新手琳琳 发布于 2011-10-14 21:22 | 阅读 380 次 | 评论 0 条

c

初学C语言,希望多多指点。 刚看了switch语句,对于case后的表达式该怎样写
sunshinewei 发布于 2011-10-14 13:53 | 阅读 422 次 | 评论 0 条

C99标准格式

在最新的 C99 标准中,只有以下两种定义方式是正确的: int main( void )--无参数形式 { ... return 0; } int main( int argc, char *argv[] )--带参数形式 { ... return 0; }
yy7software 发布于 2011-10-14 11:44 | 阅读 823 次 | 评论 1 条

我叫扎西

大家好,我叫扎西。请多多关照!
我叫扎西 发布于 2011-10-13 22:15 | 阅读 436 次 | 评论 0 条

谁能帮我运行一下这个程序啊?错哪了

#include "malloc.h"#include "stdio.h"#define TRUE 1#define FALSE 0typedef int ElemType;typedef struct stacknode{ ElemType data; struct stacknode *next;} StackNode;typedef struct { struct stacknode *top; struct stacknode *next;} *LinkStack;void InitStack(LinkStack S){S->next=NULL;pr...
广西微微 发布于 2011-10-13 17:37 | 阅读 483 次 | 评论 0 条

第3章 最简单的程序设计 习题

习题3.1 /*时间:2011年10月12日11:32:14题目:习题3.1 假如我国国民生产总值的年增长率为9%,计算十年后我国国民生产总值与现在相比增长多少百分比备注:计算公式为 p=(1+r)^n r为年增长率,n为年数,p为与现在相比的倍数*/# include <stdio.h># include <math.h>int main(){ double r,p; int n; r = 9.0/100; n = 10; p = pow(1+r,n); printf("十年后我国国民生产总值与现在相比增长了%lf%\n",p*100); ...
edwardflee 发布于 2011-10-13 11:20 | 阅读 2878 次 | 评论 2 条

java的编程思想

谁给我讲讲,为什么我i能看懂别人的,自己却做不出来呢?
liuyanxjava 发布于 2011-10-13 10:35 | 阅读 961 次 | 评论 9 条

关于常量成员函数

使用const关键字进行说明的成员函数,称为常成员函数。只有常成员函数才有资格操作常量或常对象,没有使用const关键字说明的成员函数不能用来操作常对象。常成员函数说明格式如下: <类型说明符> <函数名> (<参数表>) const; 其中,const是加在函数说明后面的类型修饰符,它是函数类型的一个组成部分,因此,在函数实现部分也要带const关键字。下面举一例子说明常成员函数的特征。 例子:class Coo{public:Coo() : a(0){}int getA() const //常量成员函数{++a; //编译错误return this->a;}private:mutab...
维海 发布于 2011-10-12 23:24 | 阅读 1191 次 | 评论 0 条

关于抽象类的派生与运算符的重载测试源码

#include <iostream>using namespace std;#define PI 3.14159class shape{ public: virtual int area() const=0; virtual void show()=0;};class rectangle : public shape{ public: int _with; int _height; rectangle(int with,int height):_with(with),_height(height){} int area()const ...
维海 发布于 2011-10-12 23:19 | 阅读 1526 次 | 评论 0 条

[C#基础]通过datatable获得表的主键

通过datatable获得表的主键 Author:hobe From:Internet很多情形下我们需要知道表的主键是什么。在ADO.Net中提供了DataTable可以映射数据库的表。于是便可以利用DataTable的属性PrimaryKey,它是DataColumn[] 类型是一个数组。我们可以使用如下的代码 DataColumn[] cols;cols = Table.PrimaryKey; //注意不是cols是DataColumn数组,不是DataColumn变量。这样做主要是为了处理联合主键的问题。for(int i = 0; i < cols.Length; i++)...
yms123 发布于 2011-10-12 16:48 | 阅读 5076 次 | 评论 0 条

例题3.9 试验getchar的用法

# include <stdio.h>int main (){ char a,b,c; printf("输入三个字符:\n"); a = getchar(); //从键盘输入三个字符分别赋值给变量a、b、c b = getchar(); //比如输入ABC。输入时注意三个字符连续输入后再按回车键 c = getchar(); //如果输一个字符后就按回车键,系统会把回车也当做一个字符'\n',凑够三个字符A '\n’B就输出了 //注意getchar函数不仅可以从输入...
edwardflee 发布于 2011-10-12 10:54 | 阅读 2190 次 | 评论 0 条

怎样学好c语言

各位高手,我想学c语言,要怎么才能学好啊!帮帮忙,给点建议吧,谢谢了!
净★星 发布于 2011-10-11 22:18 | 阅读 600 次 | 评论 0 条

生成可用windbg调试的pdb。

cl.exe /od /zi optimization: /disabled (/Od) debug information format: program database for edit &amp; continue (/ZI) link /DEBUG Generate Debug info: /DEBUG
oyzcogo 发布于 2011-10-11 11:08 | 阅读 906 次 | 评论 0 条

C语言比较大小

#include <stdio.h>int main(){ int max(int a,int b); int a,b,c; printf("please input a,b,c:\n"); scanf("%d,%d",&amp;a,&amp;b); c=max(a,b); printf("maxnum=%d\n",c);}int max(int a,int b){ if(a>b) return a; else return b;}
stevenjohn 发布于 2011-10-10 23:53 | 阅读 1814 次 | 评论 12 条

C语言指针比较大小

#include <stdio.h>void main(){ void swap(int *pt1,int *pt2); int n1,n2,n3; int *p1,*p2,*p3; printf("please input three n1,n2,n3:\n"); scanf("%d,%d,%d",&amp;n1,&amp;n2,&amp;n3); p1=&amp;n1; p2=&amp;n2; p3=&amp;n3; if(n1>n2) swap(p1,p2); if(n1>n3) swap(p1,p3); if(n...
stevenjohn 发布于 2011-10-10 23:20 | 阅读 2655 次 | 评论 0 条

关于C语言指针的几个经典例题及其解析

阅读后,大家不妨做以下几件事情: 1. 对程序进行正确注释 2.画出程序流程图 3.写出程序运行的结果(模拟程序的要求) 题目1:用指针方法处理,输入3个整数,按由小到大的顺序输出 #include <stdio.h> //库函数说明 void main() //main函数定义 { void swap(int * pt1 , int * pt2); //自定义函数swap说明 int n1, n2, n3; /* 定义3整型变量 */ int *p1, *p2, *p3; /* 定义3整型指...
stevenjohn 发布于 2011-10-10 21:36 | 阅读 6668 次 | 评论 1 条

C语言指针(结构体)例子

#include <stdio.h>#include <malloc.h>typedef struct _type{ int a; char b;} Type;int main(){ int *p=NULL; Type q; q.a = 7; printf("q=%d\n",q.a); printf("q.a point=%x\n",&amp;q.a); p=&amp;(q.a); printf("p=%x\n",p); printf("p=%x\n",&amp;p); printf("p=%d\n",*p); re...
stevenjohn 发布于 2011-10-10 21:32 | 阅读 886 次 | 评论 0 条

C语言数组输出最大值

#include <stdio.h>#include <conio.h>int main(void){ int i,array[10],big; for(i=0;i<10;i++) scanf("%d\n",&amp;array[i]); big=array[0]; for(i=1;i<10;i++) if(array[i]>big) big=array[i]; printf("the big is%5d\n",big); getch();}
stevenjohn 发布于 2011-10-10 19:54 | 阅读 1072 次 | 评论 0 条