The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ...1is read off as"one 1"or11.11is read off as"tw...
分类:
其他好文 时间:
2014-06-25 12:21:32
阅读次数:
235
public class Test {public static void main(String[] args) { String s=null; //字符缓冲区,System.in系统输入 BufferedReader bf=new BufferedReader(new Input...
分类:
其他好文 时间:
2014-06-25 11:54:17
阅读次数:
186
4种控件:EditText, TextView, Button, MenuButton的点击事件,需要集成一个OnClickListener,然后overwrite一个方法来监听点击事件Menu无需做上述的操作,只需在现有一个方法中即可为菜单添加项以及进行点击事件的绑定---------------...
分类:
移动开发 时间:
2014-06-25 11:53:36
阅读次数:
222
相对布局:RelativeLayoutandroid:layout_above 将该控件置于给定ID的控件之上android:layout_below 将该控件置于给定ID的控件之下android:layout_toLeftOf 将该控件置于给定ID的控件的左边android:layout_t...
分类:
移动开发 时间:
2014-06-25 11:52:51
阅读次数:
232
android 模拟器手机如何添加文件到sd卡?在DDMS中直接添加文件到模拟器sd卡如果出现错误类似:Failed to push XXXXX.txt on emulator- : Read-only file system的错误,原因是你的sdcard权限不够,需要直接创建一个SDCARD 。一...
分类:
其他好文 时间:
2014-06-25 11:35:42
阅读次数:
184
题解
题目要求是,有两种操作,从头取出一个字符,或者从尾取出一个字符,加到一个新的字符串末端,然后保证这个字符串是所有可能生成的字符串中,字典序排列最小的那个。依旧是贪心的想法,谁小我取谁即可。特殊判断两者相同的。一旦两者相同,那么就接着判断下一种,直到找到更小的为止。
另外需要注意两点,题目的输入很变态,要一个字母一行的输入,所以用cin或者用scanf(" %c", &ch)。cin不多说了,除了慢点其他没啥缺点。scanf中为何要加上一个空格呢?因为在格式串中,空格的意思是匹配输入中的所有换行、TAB...
分类:
其他好文 时间:
2014-06-25 08:46:12
阅读次数:
243
SafeGod在coolpad(4.0)上运行,登陆进去的设备列表界面遇到的问题,三星和索尼没有这个问题。
06-24 15:23:06.897: E/AndroidRuntime(12655): FATAL EXCEPTION: main
06-24 15:23:06.897: E/AndroidRuntime(12655): java.lang.RuntimeException: ...
分类:
移动开发 时间:
2014-06-25 07:54:20
阅读次数:
305
#include
#include
#include
#include
#include
int main( void )
{
daemon_init();
fprintf(stderr, "main进程[%d]\n", getpid() );
while( 1 )
{
}
exit(0);
}
i...
分类:
其他好文 时间:
2014-06-25 07:07:43
阅读次数:
204
例子:实现目标,用Python编写用户登录验证脚本。知识点:1、while和if控制流2、运算表达式验证过程:脚本:#!/usr/bin/envpython#filename:Userloginauthentication#importsysname=‘Tiger‘passwd=‘123456‘counter=0times=3whileTrue:#-----------无限循环username=raw_input(‘..
分类:
编程语言 时间:
2014-06-25 06:19:51
阅读次数:
272
#!/bin/bash
echo"这个是系统初始化脚本,请慎重运行!"
input_fun()
{
OUTPUT_VAR=$1
INPUT_VAR=""
while[-z$INPUT_VAR];do
read-p"$OUTPUT_VAR"INPUT_VAR
done
echo$INPUT_VAR
}
input_again()
{
MYHOSTNAME=$(input_fun"pleaseinputthehostname:")
DOMAINNAME=$(input_fun"p..
分类:
其他好文 时间:
2014-06-25 06:16:37
阅读次数:
345