例如:文件A的路径是/home/web/lib/img/cache.php文件B的路径是/home/web/api/img/temp/show.php那么,文件A相对于文件B的路径是../../lib/img/cache.phpfunctiongetRelativePath($urla,$urlb){
/*******第一步:获取两个文件的相同路径并去掉*****/
//获取路径名
$a_dirnam..
分类:
Web程序 时间:
2014-08-03 23:32:16
阅读次数:
293
//冒泡排序publicvoidmaoPaoSort(intarr[]){
for(inti=0;i<arr.length-1;i++){
for(intj=0;j<arr.length-1-i;j++){
setHuan();
}
}
}
//数组元素的交换方法
publicvoidsetHuan(int[]arr,inti,intj){
if(a[i]>a[j]){
inttemp=a[j];
a[j]=a[i];
a[i]=temp;
}
}
//直接排..
分类:
其他好文 时间:
2014-08-03 23:30:38
阅读次数:
263
很自然想起来递归:
代码:
#include
#include
using namespace std;
typedef struct tree1{
int data;
struct tree1 * lchild;
struct tree1 * rchild;
}Tree,* pTree;
void createTree(pTree & p){
int temp ;
scan...
分类:
其他好文 时间:
2014-08-03 23:23:58
阅读次数:
267
//使用数组queue[ ]存放结点队列void BFS( ) { head=0; tail=1; queue[head]=首结点的值; while (head<tail) //队列不空 { temp=tail; for (k=head; k<=ta...
分类:
其他好文 时间:
2014-08-03 23:03:16
阅读次数:
250
本文通过文件操作读取树莓派CPU温度,在linux系统中任何设备的操作都被抽象成为文件读写,通过读取/sys/class/thermal/thermal_zone0/temp文件中的内容便获得树莓派CPU的温度。本文通过以下几个部分说明如何读取和应用该温度参数——1.shell脚本操作;2linux文件IO操作,3.python文件操作; 4.通过python requset上传至yeelink平台。...
分类:
其他好文 时间:
2014-08-02 18:29:04
阅读次数:
578
Problem Description输入n(n#includeint main(){ int n,i,j,flag,temp,a[100]; while(scanf("%d",&n)!=EOF&&n!=0) { for(i=0;i<n;i++) scanf...
分类:
其他好文 时间:
2014-08-02 12:45:23
阅读次数:
170
man (1 系统命令) scanf 可以查看函数具体用法 2 用户命令 3标准库函数C语言没有输入输出,他用的是标准库中的输入输出if(0==scanf("%d",&temp)){scanf("%*[^\n]%*c")}1.scanf返回值,返回正确读入的字符个数,如果用户输入脏数据,返回0.f....
分类:
其他好文 时间:
2014-08-02 12:16:13
阅读次数:
265
模板
#include
#include
#include
#include
using namespace std;
void cheng( char *a, char *b, char *sum )
{
int temp[2500];
int lena,lenb,l;
lena=strlen(a);
lenb=strlen(b);
int len = lena + lenb...
分类:
其他好文 时间:
2014-08-01 23:15:52
阅读次数:
309
vim 文件检测删除文件,使得F5编译的时候不重复执行上次产生的程序func! CompileRunGpp()exec "w"let temp = "/home/darkdream/problem/exe/ " "后面留一个空格以便替换let outfilename=subst...
分类:
其他好文 时间:
2014-08-01 22:48:32
阅读次数:
305
#include#include#include#includeusing namespace std;queue Q;int temp;void tringle(const int n){ Q.push(1); for(int i=2;i<=n;i++) { Q.p...
分类:
其他好文 时间:
2014-08-01 18:31:12
阅读次数:
146