重要提示: 请勿将账号共享给其他人使用,违者账号将被封禁!
查看《购买须知》>>>
找答案首页 > 全部分类 > 职业技能鉴定
搜题
网友您好, 请在下方输入框内输入要搜索的题目:
搜题
题目内容 (请给出正确答案)
[单选题]

r($sum=1,$i=8;$i>=5;$i--){$sum+=$i;}echo$sum;运行结果是()

A.10

B.15

C.26

D.27

答案
D、27
更多“r($sum=1,$i=8;$i>=5;$i--){$sum+=$i;}echo$sum;运行结果是()”相关的问题

第1题

下面代码的运行结果为 sum=( )。 5)break; $sum=$sum+$i; } echo"sum=".$sum; ?>
点击查看答案

第2题

下面程序的运行结果是 $i = 1; while($i<=5){ echo $i;> A、12345

B、123456

C、1

D、111111……死循环

点击查看答案

第3题

分析以下程序代码,输出结果正确的是。<?phpfor($i=0,$sum=0;$i<10;++$i){$sum+=$i;}echo$i,',',$sum;?>()
A.10,45

B.10,36

C.9,45

D.9,36

点击查看答案

第4题

下面是一个简单的使用RAWSOCKET实现的ping程序,填入(n)处。

/*simple ping program*/

struct sockaddr_in saddr;

int rawsock;

unsigned short in_cksum(unsigned short*addr, int len)

{ int sum=0;

unsigned short res=0;

while(1en>1){

sum+=*addr++; len-=2;

}

if(len=1){

*((unsigned char *)(&res))=*((unsigned char *)addr); sum+=res;

}

sum=(sum>>16)+(sam & 0xffff);

sum+=(sum>>16); res=~sum;

return res;

}

void ping(int signo)

{

int len;

int i;

static unsigned short seq=0;

char buff[8192];

struct timeval tv;

struet icmp*icmph=(struct icmp * )buff;

long*data=(long*)icmph→icmp_data;

bzero(buff, 8192);

gettimeofday(&tv, NULL);

icmph→icmp_type=ICMP_ECHO;

icmph→icmp_code=0;

icmph→icmp_cksum=0;

icmph→icmp_id=0;

icmph→icmp_seq=0;

icmph→icmp_id=getpid()&0xffff;

icmph→icmp_seq=seq++;

data[0]=tv.tv_sec;

data[1]=tv.tv_usec;

for(i=8; i< ; i++)

icmph→icmp_data[i]=(unsigned char)i;

icmph→icmp_cksum=in_cksum((unsigned short *)buff, ? 72);

len; sendto(rawsock, buff, 72, 0, &saddr, sizeof(saddr));

alarm(1);

}

void sigint(int signo)

{ printf("CATCH SIGINT !!! \n");

close(rawsock);

exit(0);

}

void dumppkt(char*buf, int len)

{ struct ip*iph=(struct ip*)buf;

int i=iph→ip_h1*4;

struct icmp*icmph=(struct icmp*)&buf[i];

long*data=(long*)iemph→icmp_data;

struct timeval tv;

gettimeofday(&tv, NULL);

if(icmph→icmp_type! =ICMP_ECHOREPLY)

return;

if(icmph→icmp_id! =(getpid()&0xffff))

return;

printf("From %s:ttl=% d seq=% d time=%.2f ms\n",

inet_ntoa(iph→ip_src),iph→ip_ttl?,

icmph→icmp_seq,

(tv.tv_see-data[0])*1000.0+(tv.tv_usec-data[0])/1000.0);

}

int main(int argc, char*argv[])

{ int len;

stuct timeval now;

char recvbuff[8192];

if(1){

printf("%s aaa.bbb.ccc.ddd\n", argv[0]);

exit(1);

}

rawsock=soeket(AF_INET, (2), IPPROTO_ICMP);

if(rawsock<0) {

perror("soeket");

exit(1);

}

bzero ( &saddr, sizeof(saddr));

saddr.sin_family=(3);

if( inet_aton( argv[1], &saddr.sin_addr) <0) {

printf("invalid IP address: %s\n", argv[1]);

exit(1);

}

signal(SICALRM, ping);

signal(SICINT, sigint);

alarm(1);

while (1){

len=read (4), recvbuff, 8192);

if( len<0 && errno=EINTR)

continue;

else it( len<0)

perror("read");

else if( len>0)

dumppkt(recvbuff, len);

}

close (5);

exit(0);

}

点击查看答案

第5题

以下PHP代码的运行结果是()。?phpob_start();for($i=0;$i10;$i++){echo $i;}$output = ob_get_contents();ob_end_clean();echo $ouput;?
A.12345678910

B.1234567890

C.0123456789

D.Notice提示信息

点击查看答案

第6题

参考以下循环语句代码,尝试编写当第一个循环小于100,则提示小于100跳出,当第二个循环小于200则提示小于200跳出。 以下是参考代码: while(true){ for(;;){ for($i=0;$i<10;$i++){ echo>第一个"; if($i==7){ echo"

变量7 跳出"; break 1; } } for($j=0;$j<20;$j++){ echo>第二个"; if($j==15){ echo"</20;$j++){>

变量15 跳出"; break 3; } } } echo "nononono"; }

点击查看答案

第7题

To: David Wallace<d_wallace@echo.net>

From: Barbara Smallwood<b_smallwood@echo.net>

Date: Monday, June 10th 20-- 08:42:17 A.M.

Subject: My schedule today

Dave,

I will be out of my office the (144) of the afternoon.

I will be in the south wing at a meeting from 1:30 until 3:00 and then I will be leaving for the day for an eye doctor's appointment. I did not finish double-checking the inventory numbers, but I left them with Margaret and she said she would get them done by 5:00 today. If you need me, do not (145) to call my cell phone: 333-4130.I will be checking e-mail (146) this evening as well.

See you tomorrow,

Barbara

(44)

A.rest

B.rests

C.rested

D.resting

点击查看答案

第8题

下面的PHP程序运行结果是什么?( )?phpfunction print_A(){$A=’I love php’;echo ‘A的值为:’.$A;return $A;}$B = print_A();echo ‘B值为:’.$B;?
A.A值为:I love php. B值为:I love php

B.A值为: B值为:I love php

C.A值为: B值为:

D.A值为:I love php B值为:

点击查看答案

第9题

根据下面SHELL程序内容,回答问题。 #!/bin/bash i=1 while [ $i -le 50 ] # (1) do userdel -r stud${i} # (2) i=$(($i+1 )) # (3) done echo "remove sucessful!" 上述程序为对用户操作的代码,试对其行后有#(n)形式的语句进行解释,并说明该程序完成的功能。
点击查看答案
下载上学吧APP
客服
TOP
重置密码
账号:
旧密码:
新密码:
确认密码:
确认修改
购买搜题卡查看答案
购买前请仔细阅读《购买须知》
请选择支付方式
微信支付
支付宝支付
选择优惠券
优惠券
请选择
点击支付即表示你同意并接受《服务协议》《购买须知》
立即支付
搜题卡使用说明

1. 搜题次数扣减规则:

功能 扣减规则
基础费
(查看答案)
加收费
(AI功能)
文字搜题、查看答案 1/每题 0/每次
语音搜题、查看答案 1/每题 2/每次
单题拍照识别、查看答案 1/每题 2/每次
整页拍照识别、查看答案 1/每题 5/每次

备注:网站、APP、小程序均支持文字搜题、查看答案;语音搜题、单题拍照识别、整页拍照识别仅APP、小程序支持。

2. 使用语音搜索、拍照搜索等AI功能需安装APP(或打开微信小程序)。

3. 搜题卡过期将作废,不支持退款,请在有效期内使用完毕。

请使用微信扫码支付(元)
订单号:
遇到问题请联系在线客服
请不要关闭本页面,支付完成后请点击【支付完成】按钮
遇到问题请联系在线客服
恭喜您,购买搜题卡成功 系统为您生成的账号密码如下:
重要提示: 请勿将账号共享给其他人使用,违者账号将被封禁。
发送账号到微信 保存账号查看答案
怕账号密码记不住?建议关注微信公众号绑定微信,开通微信扫码登录功能
警告:系统检测到您的账号存在安全风险

为了保护您的账号安全,请在“上学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!

- 微信扫码关注上学吧 -
警告:系统检测到您的账号存在安全风险
抱歉,您的账号因涉嫌违反上学吧购买须知被冻结。您可在“上学吧”微信公众号中的“官网服务”-“账号解封申请”申请解封,或联系客服
- 微信扫码关注上学吧 -
请用微信扫码测试
选择优惠券
确认选择
谢谢您的反馈

您认为本题答案有误,我们将认真、仔细核查,如果您知道正确答案,欢迎您来纠错

上学吧找答案