自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

Moon_K_H的专栏

落月,落月,在有月亮的黑夜,依旧存在了光芒,可若月落,在太阳没有升起的那一刻,才是天地间,最漆黑的时候.

  • 博客(48)
  • 收藏
  • 关注

原创 自定义函数

<?phpecho "";echo "Number Conmand:";echo "";echo ""; define("PI",3.1415926);function Encrypt($str){ return $str=$str+PI;}function Decrypt($str){ return $str=$str-PI;}if($_POST[sub])

2015-11-30 21:10:53 328

原创 使用常量值

<?php define("PI",3.1415); $r=10; echo "circle of radius 10 units of area:".PI*($r*$r);?>

2015-11-30 21:10:15 440

原创 使用可变变量

<?php $str_name="str_name_1"; $str_name_1="I like PHP"; echo $$str_name;?>

2015-11-30 21:09:32 500

原创 打印系统环境变量

<?php print_r($_ENV);?>

2015-11-30 21:08:45 547

原创 变量基本输出

<?php $str ="hello world!!!"; echo "$str";?>

2015-11-30 21:07:54 307

原创 数字跟字符串的转换

<?php $a =10; $b ="I is a string value"; $e =$a+$b; $f =$b+$a; echo "automatic type conversions: "; echo '10+I is a string value='.$e.""; echo "force type conversions: "; echo '10+I is a strin

2015-11-30 21:07:15 349

原创 动态输出JS代码

<?php $str=<<<mark alert("welcome into php code world!"); mark; echo $str;?>

2015-11-30 21:06:12 692

原创 区分单引号和双引号

<?php $a = 1; echo"The strings is:$a".""; echo'printf string:$a';?>

2015-11-30 21:05:16 460

原创 用指针函数输出学生成绩

#includefloat *search(float(*p)[4],int n){ float *pt; pt=*(p+n); return (pt);}int main(){ float score[][4]={{1,2,3,4},{2,3,4,5},{3,4,5,6},{4,5,6,7}}; float *p; int k,i; printf("enter the

2015-11-30 20:58:10 2784

原创 寻找相同元素的指针

#includevoid *find(int *pa, int *pb, int an, int bn){ int *paa, *pbb; paa=pa; pbb=pb; while(paa<pa+an&&pbb<pb+bn) { if(*paa<*pbb) { paa++; } else if(*paa>*pbb) { pbb++; } e

2015-11-30 20:57:12 408

原创 使用指针连接两个字符串

#includevoid connect(char *st1, char *st2, char *q){ for(;*st1!='\0';) { *q=*st1; st1++; q++; } for(;*st2!='\0';) { *q=*st2; st2++; q++; } *q='\0';}int main(){ char str1[]

2015-11-28 15:27:22 9098 2

原创 用指针实现逆序列存放数组元素值

#includeint main(){ int a[10]={1,2,3,4,5,6,7,8,9,10}; int *p=a+9; int i=0; for(i=0;i<10;i++) { printf("%d,",*p); p--; } printf("\n"); return 0;}

2015-11-28 15:26:20 1872

原创 用指针数组构造字符串数组

#includeint main(){ char *week[]={"Monday","Tuesday","Wednesday","Thursday","Friday" ,"Saturday","Sunday"}; int i; printf("Please enter a number for week:\n"); scanf("%d",&i); printf("The week

2015-11-28 15:25:24 428

原创 使用指向指针的指针对字符串排序

#include#includevoid sort(char *strings[], int n){ char *temp; int i,j; for(i=0;i<n;i++) { for(j=i+1;j<n;j++) { if(strcmp(strings[i],strings[j])>0) { temp=strings[i]; strings

2015-11-27 22:13:01 734

原创 使用指针的指针输出字符串

#includeint main(){ char *strings[]={"A","B","C","D","E"}; char **p,i; p=strings; for(i=0;i<5;i++) { printf("%s\n",*(p+i)); } return 0;}

2015-11-27 22:11:32 982

原创 使用指针查找数列中的最大值和最小值

#includeint max_min(int a[],int n , int *max, int *min){    int *p;    *max= *min= *a;    for(p=a+1;p    if(*p>*max)    *max=*p;    else if(*p    *min=*p;    return 0;}in

2015-11-27 22:10:36 7778 2

原创 使用指针输出数组元素

#includeint main(){ int a[10]; int *p,i; printf("\nPlease input ten integer:\n"); for(i=0;i<10;i++) { scanf("%d",&a[i]); } printf("\n"); for(p=&a;p<(a+10);p++) { printf("%d",*p); } p

2015-11-26 18:50:51 1172

原创 指向结构体变量的指针

#includestruct student{ int num; char name[20]; char sex; int age; float score;};int main(){ struct student student1={1000,"zhangsan",'Man',20,89.9}; struct student *p; p=&student1; pr

2015-11-26 18:50:08 407

原创 指针实现整数排序

#includevoid swap(int *p1, int *p2){ int temp; temp=*p1; *p1=*p2; *p2=temp;}void exchange(int *pt1, int *pt2, int *pt3){ if(*pt1<*pt2) { swap(pt1,pt2); } if(*pt1<*pt3) { swap(pt1,p

2015-11-26 18:49:27 647

原创 获取BIOS常规内存容量

#include#includeint main(){    int memsize;    memsize=biosmemory();    printf("\nBIOS regular memory size is %dKB",memsize);    return 0;}

2015-11-26 18:48:33 898

原创 获取当前日期与时间

#include#includeint main(){ time_t now; time(&now); printf("\n Now is:%s",ctime(&now)); return 0; }

2015-11-22 13:48:40 474

原创 对数组进行升序和降序排序

#include#includeint main(){ int i,comp1(),comp2(); int num[10]={125,-26,53,12,-6,96,46,85,-45,785}; printf("the original arrat is :\n"); for(i=0;i<10;i++) { printf("%10d",num[i]); } qsort(

2015-11-22 13:46:19 6014

原创 字母检测

#include#includeint main(){ char ch, ch1; while(1) { printf("input the character('q' to quit):"); ch=getchar(); ch1=getchar(); if(ch=='q'||ch=='Q') break; if(isalpha(ch))

2015-11-22 13:44:10 511

原创 显示程序运行时间

#include#includeint main(){ time_t start,end; start=time(NULL); sleep(10); end=time(NULL); printf("%f\n",difftime(end,start)); return 0;}

2015-11-22 09:30:16 466

原创 显示当前日期和时间

#includeint main(){ struct date d; struct time t; getdate(&d); gettime(&t); printf("%d%d%d\n",d.da_year,d.da_mon,d.da.day); printf("%d%d%d",t.ti_hour,ti_min,ti_sec); return 0;}

2015-11-22 09:29:18 311

原创 设置DOS系统时间

#include#includeint main(){ struct time sett,now; struct time origint; gettime(&origint); printf("original time is:%d:%d:%d\n",origint.ti_hour, origint.ti_min, origint.ti_sec); sett.ti_

2015-11-20 17:34:52 877

原创 利用biostime()读取并设置BIOS的时钟

#include#includeint main(){ long origin,new; origin=biostime(0,0); printf("\nthe current time is %ld\n",origin); new=biostime(1,500); printf("The new time is %ld",new); return 0;}

2015-11-20 17:31:07 2071

原创 利用strlwr()任意大写字母转小写

#include#include#includeint main(){ char str[20]; printf("Please input string: "); gets(str); strlwr(str); printf(str); printf("\n"); return 0;}

2015-11-20 17:26:51 917

原创 字符串复制到指定空间

从键盘中输入字符串1和字符串2,将字符串内容保存到内存空间中。#include#includeint main(){ char str1[30], str2[30]; char *p1, *p2; printf("Please input string1: "); gets(str1); printf("Please input string2: "); gets(str2)

2015-11-20 17:25:33 385

原创 查找文件位置

从键盘中输入str1和str2,查找str1字符串中第一个不属于str2字符串中字符的位置,并将该位置输出;再从键盘中输入str3和str4,查找在str3中是否包含str4,无论包含与否给出提示信息。#include#includeint main(){ char str1[30], str2[30], str3[30], str4[40], *p; int pos; prin

2015-11-20 17:24:16 344

原创 复制当前目录

将当前目录复制到数组cdir中并在屏幕上输出:#include#includeint main(){ char *filename="mingriXXXXXX", *p; p=mktemp(filename); printf("%s\n",p); return 0; }

2015-11-20 17:20:20 327

原创 产生唯一文件

在目录中产生一个唯一的文件:#include#includeint main(){ char *filename="YYYYY", *p; p=mktemp(filename); printf("%s\n",p); return 0;}

2015-11-20 17:18:52 446

原创 linux下运行strlwr函数的自定义

因为兼容性的问题,strlwr,strupr函数不什标准的C函数库,只能在VC中使用。因此linux,gcc需要自定义strlwr函数原型。自己写一个strlwr.h原型,放在/usr/inlcude/里面。char *strlwr(char *s){ char *str; str = s; while(*str != '\0') { if(*str >= 'A' && *s

2015-11-20 15:03:12 3820

原创 求最大公约数和最小公倍数

#includeint GCD(int m, int n){ int k,j; if(n>m) { k=n; n=m; m=k; } while((j=m%n)!=0) { m=n; n=j; } return (n);}int LCM(int m, int n, int A){ return (m*n/A);}int main(){

2015-11-17 14:27:40 315

原创 求直角三角形的斜边

#include#includeint main(){ int a,b; int sum; printf("Please input two integer numbers: "); scanf("%d%d",&a,&b); sum=hypot(a,b); printf("%d\n",sum); return 0;}

2015-11-17 14:26:36 1933

原创 求相对的最小整数

#include#includeint main(){ int a; float Interger; printf("Please input a numbers: "); scanf("%d",&a); Interger=ceil(a); printf("The result is :\n%f\n",Interger); return 0;}#include#incl

2015-11-17 14:25:30 364

转载 ubuntu下 pdo_mysql扩展项详细安装

原文来自:http://blog.csdn.net/liruxing1715/article/details/8268513本文内容是以 CentOS 为例,红帽系列的 Linux 方法应该都是如此,下面就详细说明步骤,在这里严重鄙视哪些内容啰嗦、说的杂七杂八的有关 PDO 编译安装的文章。1、进入 PHP 的软件包 pdo 扩展目录中(注:不是 PHP 安装目录)

2015-11-15 00:58:10 3084 1

原创 C语言求数组元素中的最小值

#includeint array(int n,int Str[]){ int j; //int min=0; int min=Str[0]; for(j=0;j<n;j++) { if(min>Str[j]) {

2015-11-14 15:26:51 19755 1

原创 打印1~5的阶乘

首先明白阶乘的概念:求1-10的阶乘:#includeint main(){ int i,sum=0,j=1; for(i=1;i<11;i++) { j=j*i; sum=sum+j; } printf("%d\n",sum); return 0;}然后打印1~5阶乘:#includeint fac(int sum){ static int j=

2015-11-14 15:09:49 1314

原创 使用函数计算学生平均身高

#includefloat Tail(float STeight[],int number){ int i; float sum=0; float aver; for(i=0;i<number;i++) { sum=sum+STeight[i]; } aver=(float)sum/(float)number; return (aver);}int main(){

2015-11-12 15:35:47 4103

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除