![](https://lstatic.shangxueba.com/jiandati/pc/images/pc_jdt_tittleico.png)
在While语句中,当指定DO而没有指定While语句时,产生P£¯S报警。()
![](https://lstatic.shangxueba.com/jiandati/pc/images/jdt_q_ckda.png)
![](https://lstatic.shangxueba.com/jiandati/pc/images/jdt_panel_vip.png)
![](https://lstatic.shangxueba.com/jiandati/pc/images/jdt_q_wyda.png)
- · 有6位网友选择 错,占比60%
- · 有4位网友选择 对,占比40%
【说明】
本程序可以将字符串s1中出现的所有s2子串替换成s3,形成一个新串,但不破坏字符串s1。
【代码】
include<stdio.h>
include<stdlib.h>
include<string.h>
char*replace(char *s1, char *s2,char *s3)
{ char *p, *q, *r, *s; int |2,|3, i=0;
|2=strlen(s2);
|3=strlen(s3);
p=s1;
while((p=strstr(p,s2))!=NULL)
{ i++; /* 统计s2串出现的次数*/
(1);
}
i=(2);
s=r=(char*)malloc(i); /*分配动态内存存放新字符串*/
p=s1;
while(1)
{ q=strstr(p, s2); /* s2串是否在s1中出现,q是首次出现的位置*/
if(q!=NULL)
{ i=q-p;
(3);
r+=i;
(4);
r+=|3;
p=q+|2; /*将指向s1串的指针移到s2子串出现的位置后,
为下一次循环做好准备*/
}
else /*q为空,表示剩余的s1串中已经没有s2*/
{ (5);
break; /*终止循环*/
}
}
return(s); /*返回指向所形成的新串的指针*/
}
void main()
{ char *a="sabcababde", *b="ab", *c="efg", *d;
d=replace(a, b, c); printf("result=%s\n", d); free(d);
}
(a)考虑图11-54(a)所示的系统,证明:若G(s)H(s)=-1(P11.54-1),则xt(t)=xi(t)。
假设在图11-54(a)中将端点1和2连接起来,并使xi(t)=0,那么若仍满足式(P11.54-1),系统的输出应该保持不变。现在这个系统在没有任何输入时产生了一个输出。因此,只要满足式(P11.54-1),图11-54(b)所示系统是一个振荡器。
(b)在实际中一般常用的是正弦波振荡器。对于这样的振荡器,可以将(P11.54-1)的条件重写为G(jω0)H(jω0)=-1(P11.54-2),当式(P11.54-2)满足时,图11-54(b)所示的系统在ω0处的闭环增益值是什么?
(c)一个正弦振荡器可以利用图11-54(c)所示电路,根据上述原理来构成。该放大器的输入是电压v1(t)和v2(t)之差。在这个电路中,放大器的增益为A,输出电阻是R0;Z1(s),Z2(s)和Z3(s)都是阻抗。每一个都是一个线性时不变系统的系统函数,其输入是流入该阻抗元件的电流,输出是跨在该元件两端的电压。对这个电路可以证明
(ii)若Z1(s),Z2(s)和Z3(s)都是纯电抗(即电感或电容),就能写成Z1(jω)=jX1(jω),Z2(jω)=jX2(jω)和Z3(jω)=jX3(jω),其中Xi(jω),i=1,2,3均是实数。利用(b)和(i)中的结果,证明该电路能产生振荡的一个必要条件是X1(jω)+X2(jω)+X3(jω)=0。
(iii)证明:除了(ii)中的条件外,AX1(jω)=X2(jω)是该电路产生振荡必须满足的另一个条件。因为对电感来说,X1(jω)为正;对电容来说,Xi(jω)为负,所以后面这个条件要求Z1(s)和Z2(s)必须是同一种类型的阻抗,即应该同为电感或同为电容。
(iv)假设Z1(s)和Z2(s)同为电感,则有
A.int*p;cin>>*p;
B.int*s,k;*s=100
C.int *s ,k; char *p ,c; s=&k; p=&c; *p='a'; *s=1;
D.int *s,k; char *p,c; s=&k; p=&c; s=p;
设有一个SPJ数据库,包括S,P,J,SPJ四个关系模式: S( SNO,SNAME,STATUS,CITY); P(PNO,PNAME,COLOR,WEIGHT); J(JNO,JNAME,CITY); SPJ(SNO,PNO,JNO,QTY); 供应商表S由供应商代码(SNO)、供应商姓名(SNAME)、供应商状态(STATUS)、供应商所在城市(CITY)组成;零件表P由零件代码(PNO)、零件名(PNAME)、颜色(COLOR)、重量(WEIGHT)组成;工程项目表J由工程项目代码(JNO)、工程项目名(JNAME)、工程项目所在城市(CITY)组成;供应情况表SPJ由供应商代码(SNO)、零件代码(PNO)、工程项目代码(JNO)、供应数量(QTY)组成,表示某供应商供应某种零件给某工程项目的数量为QTY。 试用关系代数完成如下查询: (1) 求供应工程J1零件的供应商号码SNO; (2) 求供应工程J1零件P1的供应商号码SNO; (3) 求供应工程J1零件为红色的供应商号码SNO; (4) 求没有使用天津供应商生产的红色零件的工程号JNO; (5) 求至少用了供应商S1所供应的全部零件的工程号JNO。
为阻止美元相对于西德马克的贬值,欧洲各中央银行将不得不出售马克购买美元,对汇率进行干预。但是市场中的货币交易总量比政府所持有的全部资产多得多。
在外汇市场上每天都有价值几十亿美元的各种货币在进行交换。如果没有美国和日本的支持,即使欧共体两个最具经济影响力的成员——英国和联邦德国——所进行的干预都不会对市场产生多大的影响。然而,共同体各中央银行仅仅做出干预意图的声明就会对市场产生巨大的心理影响。
经济学家在给总统的报告中说只有当市场不寻常地无章可循时,或者是当干预与市场当前的运动方向一致时,干预才可能是有效的。
a.你同意上文所说的联邦德国对马克汇率的影响力很小的观点吗?
b.你同意上文关于干预效果的评价吗?
c.说明“仅仅作出干预意图的声明”如何对外汇市场产生“心理影响”。
d.用本章所学更精确地重述上文内容。
The following paragraphs appeared in the New York Times on September 22,1986(see“Europeans May Prop the Dollar,”p.D1):
To keep the dollar from falling against the West German mark,the European central banks would have to sell marks and buy dollars,a procedure known as intervention.But the pool of currencies in the marketplace is vastly larger than all the governments' holdings.
Billions of dollars worth of currencies are traded each day.Without support from the United States and Japan,it is unlikely that market intervention from even the two most economically influential members of the European Community-Britain and West Germany-would have much impact on the markets.However,just the stated intention of the Community's central banks to intervene could disrupt the market with its psychological effect.
Economists say that intervention works only when markets turn unusually erratic,as they have done upon reports of the assassination of a President,or when intervention is used to push the markets along in a direction where they are already headed anyway.
a.Do you agree with the statement in the article that Germany had little ability to influence the exchange rate of the DM?
b.Do you agree with the last paragraph's evaluation of the efficacy of intervention?
c.Describe how“just the stated intention”to intervene could have a“psychological effect”on the foreign exchange market.
d.Try your hand at rewriting the above paragraphs in more precise language so that they reflect what you learned in this chapter.
为了保护您的账号安全,请在“简答题”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!