思路:m和n如果有公约数,则安全洞存在,无公约数或公约数为1,则无
#include
int gcd(int a,int b)
{
if(b==0)return a;
else
{
int r;
while(b!=0)
{
r=a%b;
a=b;
...
分类:
其他好文 时间:
2014-05-07 02:54:02
阅读次数:
283
首先说明下,下面两种方法均可以获得手机的mac地址,但是有个限制,是在iOS一下才可以获得。iOS7以后苹果对于sysctl和ioctl进行了技术处理,MAC地址返回的都是02:00:00:00:00:00。官方文档上这样写的“Twolow-level networking APIs that used to return a MAC address now return thefixed
v...
分类:
移动开发 时间:
2014-05-07 02:49:17
阅读次数:
612
题目:
A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null.
Return a deep copy of the list.
思路:
主要是深层复制的问题:
本题比较简...
分类:
其他好文 时间:
2014-05-07 02:44:38
阅读次数:
344
public class IsInteger {
private IsInteger(){};
public static boolean isInteger(String value) {
try {
Integer.parseInt(value);
return true;
} catch (N...
分类:
其他好文 时间:
2014-05-06 23:27:37
阅读次数:
348
OJ题目:click here~~
题目分析:1……n按顺序围成一个圈,1与n相邻。交换相邻两个数算1步。至少需要多少步,得到一个逆方向的1……n的圈。
分两半,使用冒泡排序,排成逆序的交换次数之和即为结果。
AC_CODE
int f(int n){
return n*(n - 1)/2;
}
int main(){
int n , t;
cin >> t;
...
分类:
其他好文 时间:
2014-05-06 23:15:55
阅读次数:
301
1,有几位数字
#include
int main_2_1_digit(){
int n;
while(scanf("%d",&n)){
int count = 0;
if(n==0)
count = 1;
while(n){
count++;
n/=10;
}
printf("%d\n",count);
}
return 0;
}
...
分类:
其他好文 时间:
2014-05-06 21:20:19
阅读次数:
374
DataInputStream和DataOutputStream
往二进制文件中读和写入java基本数据类型
public class BinaryReadWrite {
private DataInputStream dis = null;
private DataOutputStream dos = null;
private String s_FilePath = "config\...
分类:
编程语言 时间:
2014-05-06 21:12:07
阅读次数:
567
SpringMVC遭遇checkbox的问题是:当checkbox全不选时候,则该checkbox域的变量为null,不能动态绑定到spring的controller方法的入参上,并抛出异常。解决方案:1、javascript方式提交,提交前拼提交参数串,拼完后通过ajax方式提交。可以使用controller请求参数绑定。缺点:逐..
分类:
编程语言 时间:
2014-05-06 20:18:00
阅读次数:
416
此方法不必删除目录重新下载:针对于第一次成功checkout,一段时间后,update 报此
403错误,我找到了解决方法:即 使用switch 重新定位svn路径,解决这个问题。(附图)ps:能svn checkout
那么你的路径就是正确的,如果大小写错误,svn是不支持checkout。如果是...
分类:
其他好文 时间:
2014-05-06 18:19:39
阅读次数:
354
如下图:选择了子数据,默认选中父级数据,数据库中会存储两条数据为使脚本通用性更好,不写死两级,可将数据放到List里处理,代码如下: String
companyName = null; companyName = "测试公司1.1"; stepInfo("校验数据"); DBU...
分类:
其他好文 时间:
2014-05-06 18:14:09
阅读次数:
282