#include<stdio.h>
#include<stdlib.h>
#include<assert.h>
doublemy_pow(constdoublenumber,intn)
{
assert(number);
if(n>0)
{
returnnumber*my_pow(number,n-1);
}
elseif(n<0)
{
return(1/number)*my_pow(number,n+1);
}
else
retu..
分类:
其他好文 时间:
2015-11-25 01:17:11
阅读次数:
175
if,else,elseif指令switch,case,default,break指令list,break指令include指令import 指令noparse指令compress指令escape,noescape指令assign 指令global 指令local 指令setting 指令用户自定义...
分类:
其他好文 时间:
2015-11-23 00:55:58
阅读次数:
139
#define_CRT_SECURE_NO_WARNINGS1
#include<stdio.h>
#include<stdlib.h>
#include<assert.h>
intint_computer(intnum1,char*p,intnum2)
{
if(p=="-a")
returnnum1+num2;
elseif(p=="-s")
returnnum1-num2;
elseif(p=="-m")
returnnum1*num2;
elseif(p=="-d"..
分类:
编程语言 时间:
2015-11-17 19:13:32
阅读次数:
235
#include<stdio.h>
#include<stdlib.h>
#include<assert.h>
intcalculator(intnum1,char*p,intnum2)
{
if(p=="-a")
returnnum1+num2;
elseif(p=="-s")
returnnum1-num2;
elseif(p=="-m")
returnnum1*num2;
elseif(p=="-d")
returnnum1/num2;
else
return-1..
分类:
编程语言 时间:
2015-11-17 07:05:32
阅读次数:
215
第1章:起点Chunks: 语句块每个语句结尾的分号是可选的,如果同一行有多个语句最好使用分号分隔;dofile("lib1.lua") -- 执行lua文件全局变量:局部变量用local修饰,否则就是全局变量保留字: if then else elseif end and or not fucti...
分类:
其他好文 时间:
2015-11-15 23:22:04
阅读次数:
237
#include<stdio.h>intmain(){doublefunction(intn,intk);inta=0;intb=0;doublec=0;scanf("%d%d",&a,&b);c=function(a,b);printf("%lf\n",c);system("pause");return0;}doublefunction(intn,intk){if(k==0)//k==0返回1{return1;}elseif(k>0)//k>0返回n的k次..
分类:
其他好文 时间:
2015-11-10 01:50:27
阅读次数:
197
#define_CRT_SECURE_NO_WARNINGS#include<stdio.h>intmain(){chara;intnum=0;intspace=0;intother=0;while((a=getchar())!=‘\n‘){if((a>=‘0‘)&&(a<=‘9‘))num++;elseif(a==‘‘)space++;elseother++;}printf("%d%d%d",num,space,other);system("pause");retur..
分类:
其他好文 时间:
2015-11-01 19:37:57
阅读次数:
149
#include<stdio.h>
#include<stdlib.h>
intbinsearch(intx,intarr[],intleft,intright)
{
while(left<=right)
{
intmid=(left+right)/2;
if(arr[mid]==x)
{
returnmid;
}
elseif(arr[mid]<x)
{
left=mid+1;
}
else
{
right=mid-1;
}
}
return-1;
}
intmain()..
分类:
编程语言 时间:
2015-10-31 18:39:55
阅读次数:
214
#include<stdio.h>
intmain()
{
intcou=0;
charch;
while((ch=getchar())!=‘\n‘)
{
if(ch==‘{‘)
cou++;
elseif(ch==‘}‘)
{
if(cou==0)
printf("匹配不成功!");
cou--;
}
}
if(cou==0)
printf("匹配成功!");
else
printf("匹配不成功!");
return0;
}
分类:
其他好文 时间:
2015-10-31 18:38:57
阅读次数:
159
条件判断语句(这些语句都是写在smarty模板中的) {if $name eq 'Tom'} Welcome Sir {elseif $name eq 'Wilma'} Welcome Ma'am {else} Welcome,whatever y...
分类:
其他好文 时间:
2015-10-31 15:44:51
阅读次数:
235