猜数字#include<stdio.h>
#include<time.h>
intmain()
{
intn,m,i=0;
srand(time(NULL));
n=rand()%100+1;
do{
printf("输入所猜的数字:");
scanf("%d",&m);
i++;
if(m>n)
printf("错误!所猜的数太大了!\n");
elseif(m<n)
printf("..
分类:
编程语言 时间:
2015-04-24 01:24:01
阅读次数:
165
用栈能很easy的解决,直接贴代码:
struct ListNode{
int m_nValue;
ListNode *m_pNext;
};
void PrintListRevers(ListNode* pHead)
{
stack nodes;
ListNode* pNode = pHead;
while(pNode != NULL)
{
...
分类:
其他好文 时间:
2015-04-24 01:08:40
阅读次数:
110
看以下几步操作即可:
实例化带cookie DefaultHttpClient 网络通信类
/**
* 返回请求队列
* @return
*/
private RequestQueue getRequestQueue() {
if (mRequestQueue == null) {
DefaultHttpClient httpclient ...
分类:
移动开发 时间:
2015-04-24 01:07:47
阅读次数:
1130
js 的变量名可以由 _,数字,字母,$ 组成,且 不能以数字开头。在 jQuery 中就定义了一个全局变量 $ 。声明变量用 var 变量名,如果不用 var,则会污染全局。js 变量类型包括:① 数值类型② 字符串类型③ 布尔类型(true,false)④ null 类型var a = null...
分类:
编程语言 时间:
2015-04-24 00:56:02
阅读次数:
156
简介
Findbugs是一个在java程序中查找bug的程序,它查找bug模式的实例,也就是可能出错的代码实例,注意Findbugs是检查java字节码,也就是*.class文件。其实准确的说,它是寻找代码缺陷的,很多我们写的不好的地方,可以优化的地方,它都能检查出来。例如:未关闭的数据库连接,缺少必要的null check,多余的 null check,多余的if后置条件,相同...
分类:
数据库 时间:
2015-04-23 23:36:21
阅读次数:
388
一、读取assets文件下文件products.json
public String readAssetFile(Context c, String file) {
Elapsed profiler = new Elapsed();
BufferedReader bufReader = null;
try {
InputS...
分类:
移动开发 时间:
2015-04-23 23:34:25
阅读次数:
328
使用中遇到的问题解决方法
刚开始使用screen时会报错,跟用户的权限相关。
[dc@dc010.tj.momo.com ~]$ screen
Cannot open your terminal ‘/dev/pts/4’ - please check.
解决方法是键入:
script /dev/null
详细说明:http://urchin.blog.51cto.com...
分类:
系统相关 时间:
2015-04-23 23:30:24
阅读次数:
276
PopupWindow popupWindow = new PopupWindow(this); popupWindow.setContentView(LayoutInflater.from(this).inflate(R.layout.activity_main, null)); popu...
Android 打开相册,选择一张图片并返回一 打开相册private static final int ALBUM_OK = 0;Intent albumIntent = new Intent(Intent.ACTION_PICK, null); albumIntent.setDataAndT.....
分类:
移动开发 时间:
2015-04-23 21:25:56
阅读次数:
220
严重: Servlet.service() for servlet default threw exception org.hibernate.AssertionFailure: null id in com.iprecare.entity.Inventroyrecord entry (don‘t flush the Session after an exception occurs) ...
分类:
Web程序 时间:
2015-04-23 20:05:12
阅读次数:
130