#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 01:42:54
阅读次数:
119
#include<stdio.h>
#include<stdlib.h>
intmain()
{
intch=0;
intcount=0;
while((ch=getchar())!=EOF)//输入字符不为空,结束时用^Z
{
if((ch==‘}‘)&&(count==0))
printf("notmatch\n");
elseif(ch==‘{‘)
{
count++;
}
elseif((ch==..
分类:
其他好文 时间:
2015-10-29 18:27:48
阅读次数:
187
我们分两条主线来介绍SDRAM的读写:地址线和数据线首先地址线上,在FPGA启动,延时500微妙。然后地址计数器cntwr每等到延时500us加1(elseif(delay_done)cntwr<=cntwr+1‘b1)直到加到63,然后让地址寄存器addr加1。(elseif(!wr_done&&cntwr==6‘h3f)addr<=addr+1..
分类:
其他好文 时间:
2015-10-28 19:32:18
阅读次数:
228
获取客户端IP地址::function getIp(){if(!empty($_SERVER['HTTP_CLIENT_IP'])){ return $_SERVER['HTTP_CLIENT_IP']; }elseif(!empty($_SERVER['HTTP_X_FORVARDED_FOR.....
分类:
Web程序 时间:
2015-10-28 19:04:38
阅读次数:
143
<?php
$t=date("50");
if($t<"10"){
echo"Haveagoodmorning!";
}elseif($t<"20"){
echo"Haveagoodday!";
}else{
echo"Haveagoodnight!";
}
?>
<?php$num=100;
switch($num){
case10:
echo("好");
break;
case20:
echo("很好");
break;
default:
..
分类:
其他好文 时间:
2015-10-28 17:30:10
阅读次数:
125
#include<stdio.h>intbin_search(intarr[],intsize,intkey){intleft=0;intright=size-1;while(left<=right){intmid=(left+right)/2;if(arr[mid]>key)right=mid-1;elseif(arr[mid]<key)left=mid+1;else{returnmid;//如果能找到,则返回mid下标}}return-1;如果找..
分类:
编程语言 时间:
2015-10-28 07:09:21
阅读次数:
262
#include<stdio.h>
intmain()
{
chars[20];
charnum=0;
intnum_count=0;
intspace_count=0;
intother_count=0;
while((num=getchar())!=‘\n‘)
{
if(num>=‘0‘&&num<=‘9‘)
{
num_count++;
}
elseif(num==‘‘)
{
space_count++;
}
else
{
other_count..
分类:
编程语言 时间:
2015-10-27 07:08:05
阅读次数:
234
functionlsShowNotice(e,t,n){
varr;
if(typeofe=="string"){
r=jQuery("#"+e)
}elseif(typeofe=="object"){
r=e
}
vari,s;
switch(t){
case"jquery":
i="multiplejQueryissue";
s=‘ItlookslikethatanotherpluginoryourthemeloadsanextracopyofthejQuerylibrary..
分类:
其他好文 时间:
2015-10-25 19:30:20
阅读次数:
169
#include<stdio.h>
intmain()
{
charstring[50];
charc;
inti,num=0,word=0;
gets(string);
for(i=0;(c=string[i])!=‘\0‘;i++)
{
if(c==‘‘)
{
word=0;
}
elseif(word==0)
{
word=1;
num++;
}
}
printf("word=%d",num);
return0;
}
分类:
其他好文 时间:
2015-10-23 00:15:24
阅读次数:
193
//编写一个程序,它从标准输入读取C源代码,并验证所有的花括号都正确的成对出现
#include<stdio.h>
intmain()
{
intch=0;
intcount=0;
while((ch=getchar())!=EOF)
{
if(ch==‘{‘)
count++;
elseif((ch==‘}‘)&&(count==0))
{
printf("匹配不成功!\n");..
分类:
其他好文 时间:
2015-10-22 19:38:32
阅读次数:
225