码迷,mamicode.com
首页 >  
搜索关键字:while case 交互 执行参数    ( 64945个结果
质因数的求法
质因数分解 /* 求质因数 */ #include #include int main() { int n,a=2; printf("please input n:"); scanf("%d",&n); if(n<=1) { printf("input error!\n"); return -1; } while(a*a < n) { while(n%a==0) ...
分类:其他好文   时间:2014-05-26 05:50:40    阅读次数:279
模拟鼠标点击按钮的简单示例
原理         首先枚举到目标按钮所在程序的窗口,然后在该窗口内枚举控件获取控件的句柄,获取到按钮的句柄后可通过SendMessage或者PostMessage来发送消息模拟鼠标点击按钮等交互方式。但是因为枚举窗口和句柄都是使用WIN32 API,所以只能枚举到WIN32的控件,对于那些不是微软提供的控件则表示无能为力了。本示例简单地模拟一个往打字机里面写入数据,点击确认的方法。...
分类:其他好文   时间:2014-05-26 04:08:01    阅读次数:264
【LeetCode】Climbing Stairs
题目 You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top? 解答...
分类:其他好文   时间:2014-05-25 00:37:34    阅读次数:284
【练习题】编写打印出一个单链表的所有元素的程序【链表】
只是实现了链表ADT的部分功能。 /*---编写打印出一个单链表的所有元素的程序---*/ #include #include struct Node{ int val; struct Node *next; }; Node *findEnd(Node *list){ while(list->next) list = list->next; return list; } v...
分类:其他好文   时间:2014-05-24 22:30:37    阅读次数:232
从一道面试题(死循环里分配内存)阐述Linux的内存管理
int cnt = 0; while(1) { ++cnt; ptr = (char *)malloc(1024*1024*128); if(ptr == NULL) { printf("%s\n", "is null"); break; } } printf("%d\n", cnt); 这个程序会有怎样的输出呢?...
分类:系统相关   时间:2014-05-24 21:59:47    阅读次数:479
【练习】P62
/*---分别对单链表和双链表,只使用指针来交换两个相邻的元素。---*/ /*-单链表版本-*/ #include #include struct Node{ int val; struct Node *next; }; Node *findEnd(Node *list){ while(list->next) list = list->next; return ...
分类:其他好文   时间:2014-05-24 19:41:49    阅读次数:253
LeetCode: Anagrams [048]
【题目】 Given an array of strings, return all groups of strings that are anagrams. Note: All inputs will be in lower-case. For example: Input:  ["tea","and","ate","eat","den"] Output: ["tea","ate","eat"] 【题意】 anagrams指的是颠倒字母顺序构成的单词,以tea为例,则与它an...
分类:其他好文   时间:2014-05-24 18:36:01    阅读次数:317
UML视图(七)协作图
一、什么是协作图?    协作图是描述对象间交互的一种模式;它通过对象之间的连接和它们相互发送的消息来显示参与交互的对象。 二、协作图的作用?    协作图的建模结果用于获取对象的职责和接口。便于对对象结构的理解。 三、协作图与时序图的关系?    (1)协作图与时序图可以互相转化。    (2)协作图和时序图描述角度的侧重点不同。协作图侧重于对象间关系,展示对象结构,使其一目了然,很...
分类:其他好文   时间:2014-05-24 18:02:09    阅读次数:342
安卓实训第四天--基于HttpClient来完成数据在服务器和设备间的交互。
上午:老师首先回顾了昨天作业。 首先在安卓工程中的TOOLS文件中,解析字节流那里,不用改变,而是把服务器端的编码方式变为UTF-8,然后将在安卓工程的LoginActivity类中的USERNAME给他强制转换下。 总结一句话:如果一个字符通过某个编码转换成字节码之后,那你在转换的时候必须拿到转换之前的字节码 补充:如何改变mysql连接工具的编码方式: jdbc:mys...
分类:移动开发   时间:2014-05-24 17:14:32    阅读次数:365
【练习】P62页3.2题
/*---给你一个链表L和另一个链表P,它们包含以升序排列的整数。操作PrintLots(L,P) 将打印L中那些由P所指定位置上的元素。---*/ #include #include struct Node{ int val; struct Node *next; }; Node *findEnd(Node *list){ while(list->next) list = l...
分类:其他好文   时间:2014-05-24 14:27:42    阅读次数:224
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!