Subversion Repositories php-qbpwcf

Rev

Rev 3 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3 Rev 226
Line 1... Line 1...
1
#!/usr/bin/php
1
#!/usr/bin/php
2
<?php
2
<?php
3
 
3
 
4
/*
4
/*
5
	QBPWCF, Quick Build PHP website Component base on Fedora Linux.
5
	QBPWCF, Quick Build PHP website Component base on Fedora Linux.
6
    Copyright (C) 2015~2024 Min-Jhin,Chen
6
    Copyright (C) 2014~2025 MIN ZHI, CHEN
7
 
7
 
8
    This file is part of QBPWCF.
8
    This file is part of QBPWCF.
9
 
9
 
10
    QBPWCF is free software: you can redistribute it and/or modify
10
    QBPWCF is free software: you can redistribute it and/or modify
11
    it under the terms of the GNU General Public License as published by
11
    it under the terms of the GNU General Public License as published by
Line 17... Line 17...
17
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
    GNU General Public License for more details.
18
    GNU General Public License for more details.
19
 
19
 
20
    You should have received a copy of the GNU General Public License
20
    You should have received a copy of the GNU General Public License
21
    along with QBPWCF.  If not, see <http://www.gnu.org/licenses/>.
21
    along with QBPWCF.  If not, see <http://www.gnu.org/licenses/>.
22
    
22
 
23
*/
23
*/
24
 
24
 
25
/*
25
/*
26
將兩個16進未數值進行運算
26
將兩個16進未數值進行運算
27
*/
27
*/
Line 48... Line 48...
48
{
48
{
49
	#如果是加法
49
	#如果是加法
50
	case "+":
50
	case "+":
51
			$result=$num1+$num2;
51
			$result=$num1+$num2;
52
		break;
52
		break;
53
		
53
 
54
	#如果是減法
54
	#如果是減法
55
	case "-":
55
	case "-":
56
			$result=$num1-$num2;
56
			$result=$num1-$num2;
57
		break;
57
		break;
58
		
58
 
59
	#如果是乘法
59
	#如果是乘法
60
	case "x":
60
	case "x":
61
			$result=$num1*$num2;
61
			$result=$num1*$num2;
62
		break;
62
		break;
63
		
63
 
64
	#如果是除法	
64
	#如果是除法
65
	case "/":
65
	case "/":
66
			$result=$num1/$num2;
66
			$result=$num1/$num2;
67
		break;
67
		break;
68
		
68
 
69
	#其他運算符號
69
	#其他運算符號
70
	default:
70
	default:
71
	
71
 
72
		#show help
72
		#show help
73
		help();
73
		help();
74
		
74
 
75
		#停止執行
75
		#停止執行
76
		exit;
76
		exit;
77
}
77
}
78
 
78
 
79
#印出 16 進位的數值
79
#印出 16 進位的數值