#includeusing namespace std;int main() {int j; int i;int k;int a[100][100]={0};for (i = 1; i9)a[i][j] = k / 10 + k % 10;if (a[i][j] > 9){k = a[i][j];a...
分类:
编程语言 时间:
2015-03-22 00:25:01
阅读次数:
232
Given an integer n, generate a square matrix filled with elements from 1 to n2 in spiral order.
For example,
Given n = 3,
You should return the following matrix:
[
[ 1, 2, 3 ],
[ 8, 9, 4 ],
[...
分类:
其他好文 时间:
2015-03-21 12:41:11
阅读次数:
105
1.函数传值&探测对象window.onload=initAll;
/*
functioninitAll(){
for(i=0;i<24;i++){
varnewNum=Math.floor(Math.random()*75)+1;
document.getElementById("square"+i).innerHTML=newNum;
}
}
*/
functioninitAll(){
if(document.getElementById){//通过此属性检测..
分类:
编程语言 时间:
2015-03-20 01:34:47
阅读次数:
224
题目链接:Sqrt(x)
Implement int sqrt(int x).
Compute and return the square root of x.
这道题的要求是实现int sqrt(int x),即计算x的平方根。
考虑二分,即先令l和r分别为1和x/2+1(x的平方根一定小于等于x/2+1),然后m等于(l+r)/2,不断比较m*m和x的大小。
由于...
分类:
其他好文 时间:
2015-03-20 00:07:04
阅读次数:
166
CSS列表属性,允许你放置和改变列表项标志,或者将图像作为列表项标志。1)list-style-typelist-style-type属性用于修改列表项的标志类型。无序属性值有:disc,circle,square,none.咖啡茶可口可乐咖啡茶可口可乐咖啡茶可口可乐咖啡茶可口可乐有序属性值有dec...
分类:
Web程序 时间:
2015-03-17 10:09:46
阅读次数:
191
1、早期的Dalvik VM内部使用short类型变量来标识方法的id,dex限制了程序的最大方法数是65535,如果超过最大限制,无法编译,把dex.force.jumbo=true添加到project.properties文件中可以通过编译,在低端手机无法安装,报错误INSTALL_FAILED...
分类:
移动开发 时间:
2015-03-16 16:13:55
阅读次数:
298
A knight moves on a chessboard two squares up, down, left, or right followed by one square in one of the two directions perpendicular to the first part of the move (i.e., the move is L-shaped). Suppos...
分类:
编程语言 时间:
2015-03-15 12:27:03
阅读次数:
181
Square Coins
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 8893 Accepted Submission(s): 6069
Problem Description
People in Silverl...
分类:
其他好文 时间:
2015-03-15 09:32:03
阅读次数:
124
我们用字符串代表图的顶点(vertax),来模拟学校中Classroom, Square, Toilet, Canteen, South Gate, North Gate几个地点,然后计算任意两点之间的最短路径。
如,我想从North Gate去Canteen, 程序的输出结果应为: BFS: From [North Gate] to [Canteen]:
North Gate...
分类:
编程语言 时间:
2015-03-15 07:07:45
阅读次数:
231
题目链接:Spiral Matrix II
Given an integer n, generate a square matrix filled with elements from 1 to n^2 in spiral order.
For example,
Given n = 3,
You should return the following matrix:
[
[ 1,...
分类:
其他好文 时间:
2015-03-15 00:52:27
阅读次数:
386