<?php if($_POST["test"]) foreach($_POST["test"] as $var) echo $var."|"; print_r($_POST["test"]); ?> <form name="form" method="post" action="test.php"> <input type=checkbox name=test[] value=001>001<br /> <input type=checkbox name=test[] value=002>002<br /> <input type=checkbox name=test[] value=003>003<br /> <input type=checkbox name=test[] value=004>004<br /> <input type=checkbox name=test[] value=005>005<br /> <input type="submit" value="submit"> </form>
2012年11月30日 星期五
checkbox 多重選取
test.php
2012年11月23日 星期五
office2010 及 office2013 kms 認證 bat
@echo off
if exist "%programfiles(x86)%\microsoft office\office14\ospp.vbs" (
cscript "%programfiles(x86)%\microsoft office\office14\ospp.vbs" /osppsvcrestart
cscript "%programfiles(x86)%\microsoft office\office14\ospp.vbs" /sethst:your-kms-server
cscript "%programfiles(x86)%\microsoft office\office14\ospp.vbs" /act
)
if exist "%programfiles%\microsoft office\office14\ospp.vbs" (
cscript "%programfiles%\microsoft office\office14\ospp.vbs" /osppsvcrestart
cscript "%programfiles%\microsoft office\office14\ospp.vbs" /sethst:your-kms-server
cscript "%programfiles%\microsoft office\office14\ospp.vbs" /act
)
if exist "%programfiles(x86)%\microsoft office\office15\ospp.vbs" (
cscript "%programfiles(x86)%\microsoft office\office15\ospp.vbs" /sethst:your-kms-server
cscript "%programfiles(x86)%\microsoft office\office15\ospp.vbs" /act
)
if exist "%programfiles%\microsoft office\office15\ospp.vbs" (
cscript "%programfiles%\microsoft office\office15\ospp.vbs" /sethst:your-kms-server
cscript "%programfiles%\microsoft office\office15\ospp.vbs" /act
)
PAUSE
因應office2013上市,修改了原本office2010.bat的檔案
同時,發現之前的流程只會執行一次,如果同時安裝各種版本的就會無法同時認證
所以改了一下bat檔執行的流程
2012年11月20日 星期二
在 windows 2008 R2 上安裝 KMS server 更新
1.安裝windows 2008 R2 並完成所有更新。
2.由下列網址下載 KMS host 更新,以支援 windows 8 及 2012 啟動認證
http://support.microsoft.com/kb/2757817/en-us
3.安裝完成後執行以下兩行指令,啟動 KMS host
cscript c:\windows\system32\slmgr.vbs -ipk "your host key"
cscript c:\windows\system32\slmgr.vbs -ato
ps:
(1) windows 8 host key 支援 windows 8, windows 7, windows vista 啟動認證
(2) windows 2012 host key 支援 windows 2012, windows 2008R2, windows 2008, windows 8, windows 7, windows vista 啟動認證
資料來源:http://technet.microsoft.com/en-us/library/jj134256.aspx
4.由下列網址下載 Office 2010 啟動程式
http://www.microsoft.com/en-us/download/details.aspx?id=25095
執行 KeyManagementServiceHost.exe
然後輸入 "your host key"
5.由下列網址下載 Office 2013 啟動程式
http://www.microsoft.com/en-us/download/details.aspx?id=35584
執行 office2013volumelicensepack_en-us_x86.exe
然後輸入 "your host key"
2.由下列網址下載 KMS host 更新,以支援 windows 8 及 2012 啟動認證
http://support.microsoft.com/kb/2757817/en-us
3.安裝完成後執行以下兩行指令,啟動 KMS host
cscript c:\windows\system32\slmgr.vbs -ipk "your host key"
cscript c:\windows\system32\slmgr.vbs -ato
ps:
(1) windows 8 host key 支援 windows 8, windows 7, windows vista 啟動認證
(2) windows 2012 host key 支援 windows 2012, windows 2008R2, windows 2008, windows 8, windows 7, windows vista 啟動認證
資料來源:http://technet.microsoft.com/en-us/library/jj134256.aspx
4.由下列網址下載 Office 2010 啟動程式
http://www.microsoft.com/en-us/download/details.aspx?id=25095
執行 KeyManagementServiceHost.exe
然後輸入 "your host key"
5.由下列網址下載 Office 2013 啟動程式
http://www.microsoft.com/en-us/download/details.aspx?id=35584
執行 office2013volumelicensepack_en-us_x86.exe
然後輸入 "your host key"
2012年11月9日 星期五
Q11498: Division of Nlogonia
原文
中譯
#include "stdio.h" int main() { int K,N,M,X,Y; while( scanf(" %d",&K) != EOF && K != 0 ) { scanf(" %d %d",&N,&M); while( K-- ) { scanf(" %d %d",&X,&Y); if( X == N || Y == M ) printf("divisa"); else { if( M - Y > 0 ) printf("S"); if( M - Y < 0 ) printf("N"); if( N - X > 0 ) printf("O"); if( N - X < 0 ) printf("E"); } printf("\n"); } } return 0; }
Q11494: Queen
原文
中譯
#include "stdio.h" int main() { int x1,x2,y1,y2; while( 1 ) { scanf(" %d %d %d %d",&x1,&y1,&x2,&y2); if( x1 == 0 && x2 == 0 && y1 == 0 && y2 == 0 ) break; if( x1 == x2 && y1 == y2) printf("0\n"); else if( (x1 - x2)*(x1 - x2) == (y1 - y2)*(y1 - y2) || x1 - x2 == 0 || y1 - y2 == 0) printf("1\n"); else printf("2\n"); } return 0; }
Q11479: Is this the easiest problem?
原文
http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2474
中譯
http://luckycat.kshs.kh.edu.tw/homework/q11479.htm
http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2474
中譯
http://luckycat.kshs.kh.edu.tw/homework/q11479.htm
#include "stdio.h" int main() { int num,tmp = 1; long long int in[3]; scanf( "%d",&num); while( num-- ) { scanf(" %lld %lld %lld",&in[0],&in[1],&in[2]); if( in[0] + in[1] <= in[2] || in[0] + in[2] <= in[1] || in[1] + in[2] <= in[0] ) printf("Case %d: Invalid\n",tmp); else if( in[0] == in[1] && in[1] == in[2] ) printf("Case %d: Equilateral\n",tmp); else if( in[0] == in[1] || in[1] == in[2] || in[0] == in[2]) printf("Case %d: Isosceles\n",tmp); else printf("Case %d: Scalene\n",tmp); tmp++; } return 0; }
Q11398 - The Base-1 Number System
原文
http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2393
中譯
http://luckycat.kshs.kh.edu.tw/homework/q11398.htm
http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2393
中譯
http://luckycat.kshs.kh.edu.tw/homework/q11398.htm
#include "stdio.h" int main() { int str[50],num = 0,i,tmp = 0; char in[40],flag = 0; while( 1 ) { scanf(" %s",in); if( in[0] == '~' ) break; if( in[0] == '#' ) { int j = 1,out = 0; for(i = tmp - 1;i > -1;i--) { out += str[i] * j; j *= 2; } printf("%d\n",out); num = 0; tmp = 0; for(i = 0;i < 50;i++) str[i] = 0; continue; } if( strlen(in) == 1 ) flag = 1; else if( strlen(in) == 2 ) flag = 0; else { for(i = 0;i < strlen(in) - 2;i++) { str[tmp] = flag; tmp++; } } num++; } return 0; }
2012年11月8日 星期四
Q11369: Shopaholic
原文
中譯
#include "stdio.h" int quicksort(int p[],int left,int right) { if( left >= right ) return 0; int i,j,s,tmp; s = p[left]; i = left + 1; j = right; while( 1 ) { while( i < right && p[i] >= s ) i++; while( j > left && p[j] <= s ) j--; if( i >= j ) break; tmp = p[i]; p[i] = p[j]; p[j] = tmp; } tmp = p[left]; p[left] = p[j]; p[j] = tmp; quicksort(p,left,j - 1); quicksort(p,j + 1,right); return 0; } int main() { int num; scanf(" %d",&num); while( num-- ) { int i,j,n,p[20000]={0},save = 0,tmp; scanf(" %d",&n); for(i = 0;i < n;i++) { scanf(" %d",&p[i]); } quicksort(p,0,n - 1); for(i = 2;i < n;i+=3) { save += p[i]; } printf("%d\n",save); } return 0; }
2012年11月5日 星期一
Q11364: Parking
原文
http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2349
中譯
http://luckycat.kshs.kh.edu.tw/homework/q11364.htm
http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2349
中譯
http://luckycat.kshs.kh.edu.tw/homework/q11364.htm
#include "stdio.h" int main() { int t,n; scanf(" %d",&t); while( t ) { int i,min=100,max=0,x; scanf(" %d",&n); for(i = 0;i < n;i++) { scanf(" %d",&x); if( x > max ) max = x; if( x < min ) min = x; } printf("%d\n",(max - min) * 2); t--; } return 0; }
2012年11月2日 星期五
Q11332: Summing Digits
原文
中譯
#include "stdio.h" int f(int n) { int tmp = 0; while( n ) { if( n >= 10 ) tmp += n % 10; else tmp += n; n = n / 10; } if( tmp >= 10 ) return f(tmp); else return tmp; } int main() { int n; while (scanf(" %d",&n) != EOF && n ) { printf("%d\n",f(n)); } return 0; }
Q11219: How old are you?
原文
http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2160
中譯
http://luckycat.kshs.kh.edu.tw/homework/q11219.htm
http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2160
中譯
http://luckycat.kshs.kh.edu.tw/homework/q11219.htm
#include "stdio.h" int main() { int T,D,M,Y,d,m,y,DAYS,days,times = 1; scanf(" %d",&T); while ( times <= T ) { scanf(" %d/%d/%d",&D,&M,&Y); scanf(" %d/%d/%d",&d,&m,&y); DAYS = Y * 12 * 31 + (M - 1) * 31 + D; days = y * 12 * 31 + (m - 1) * 31 + d; if( DAYS - days < 0) printf("Case #%d: Invalid birth date\n",times); else if( DAYS - days >= 131 * 12 * 31 ) printf("Case #%d: Check birth date\n",times); else { printf("Case #%d: %d\n",times,(DAYS - days) / (12 * 31)); } times++; } return 0; }
Q11204: Musical instruments
原文
http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2145
中譯
http://luckycat.kshs.kh.edu.tw/homework/q11204.htm
http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2145
中譯
http://luckycat.kshs.kh.edu.tw/homework/q11204.htm
#include "stdio.h" int main() { int num,i,j,k,total; scanf(" %d",&num); for(i = 0;i < num;i++) { int N,M,tmp,first[32]={0},times = 1; scanf(" %d %d",&N,&M); for(j = 0;j < M;j++) { for(k =0;k < N;k++) { scanf(" %d",&tmp); if( tmp == 1 ) first[k] += 1; } } for(j = 0;j < N;j++) { if( first[j] > 0) { times *= first[j]; } } printf("%d\n",times); } return 0; }
Q11185: Ternary
原文
http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2126
中譯
http://luckycat.kshs.kh.edu.tw/homework/q11185.htm
http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2126
中譯
http://luckycat.kshs.kh.edu.tw/homework/q11185.htm
#include "stdio.h" int main() { int N; while( scanf(" %d",&N) ) { int q[1000],i = 0,j; if( N < 0 ) break; if( N == 0) q[0] = 0; while( N > 0 ) { q[i] = N % 3; N = N / 3; if( N == 0 ) break; i++; } for(j = i;j >= 0;j--) { printf("%d",q[j]); } printf("\n"); } return 0; }
Q11172: Relational Operators
原文
http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2113
中譯
http://luckycat.kshs.kh.edu.tw/homework/q11172.htm
http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2113
中譯
http://luckycat.kshs.kh.edu.tw/homework/q11172.htm
#include "stdio.h" int main() { int num,a,b; scanf(" %d",&num); while( num ) { scanf(" %d %d",&a,&b); if( a > b ) printf(">\n"); if( a < b ) printf("<\n"); if( a == b ) printf("=\n"); num--; } return 0; }
Q11059: Maximum Product
原文
http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2000
中譯
http://luckycat.kshs.kh.edu.tw/homework/q11059.htm
http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2000
中譯
http://luckycat.kshs.kh.edu.tw/homework/q11059.htm
#include "stdio.h" int main() { int N,S[20],num = 1; while( scanf(" %d",&N) != EOF && N) { int i,j,k; long long int P; for(i = 0;i < N;i++) { scanf(" %d",&S[i]); if(i == 0) P = S[i]; else { for(j = 0;j <= i;j++) { long long int tmp = 1; for(k = j;k <=i;k++) tmp *= S[k]; if( P < tmp ) P = tmp; } } } if( P < 0 ) P = 0; printf("Case #%d: The maximum product is %lld.\n\n",num,P); num++; } return 0; }
訂閱:
文章 (Atom)