[问答题]图7-5所示的流程图描述了对8位二进制整数求补的算法.该算法的计算过程如下:从二进制数的低位(最右位)开始,依次向高位逐位查看,直到首次遇到“1”时,停止查看.然后,对该“1”位左面的更高位(如果有的话),逐位求反,所得的结果就是对原二进制数求补的结果.例如:对二进制整数10101000求补的结果是01011000.设8位二进制整数中的各位,从低位到高位,依次存放在整型数组BIT的BIT[1]~BIT[8]中.例如,二进制整数10101000存放在数组BIT后,就有BIT[1]=0, BIT[2]=0, …, BIT[7]=0, BIT[8]=1.若流程图中存在空操作,则用NOP表示.流程图中(1)处按“循环变量名:循环初值,增量,循环终值”格式描述.[解析] 本题考查求补运算.求补运算是对一个数的各二进制位按位求反后再加1.例如:二进制10101000按位求反后得到的二进制是01010111,加1后为01011000.也可以这样来看,原二进制从最右边开始到遇到的第1个1为止都不变,而后面剩下的位按位求反即可.本题流程图采用的是后一种思路,首先设置一个标志sw的值为0,从最右边一位开始往左循环遍历整个二进制数,到遇到第1个1后将标志位置1.由此可见,循环要进行8次,循环变量值依次从1递增到8.根据题目要求按“循环变量名:循环初值,增量,循环终值”格式描述循环,而循环开始下面一条判断是“BIT[i]=1?”,所以循环变量是i,第1空应填i:1,1,8.如果当前遍历的二进制位BIT[i]是1,且标志sw为0时,则证明是第1次遇到1,所以直接设置sw为1即可,故第2空应填1→sw.如果当前遍历的二进制位BIT[i]是1,且标志sw为1时,说明已经不是第1次遇到1了,所以直接设置当前二进制位为0即可,故第3空应填0→BIT[i].如果当前遍历的二进制位BIT[i]是0,且标志sw为0时,则证明还没有遇到过一次1,所以该步什么都不用做,故第4空应填NOP.如果当前遍历的二进制位BIT[i]是0,且标志sw为1时,说明已经遇到过1了,所以该步需将当前的二进制位求反,故第5空应填1→BIT[i].
[问答题]编程计算下列表达式:s=n!(n从键盘上输入)
[问答题]TD_LTE如何与TD_S互操作
[问答题]阅读以下说明和C函数,填补C函数中的空缺(1)~(5),将解答写在答题纸的对应栏内.(说明)假设一个算术表达式中可以包含以下三种括号:“(”和“)”、[”和“]”、“{”和“}”,并且这三种括号可以按照任意的次序嵌套使用.下面仅考虑表达式中括号的匹配关系,其他问题暂时忽略.例如,表达式“[a.(b.5)]*c[{}]”中的括号是完全匹配的,而表达式“[a-(b-5]))*c”中的括号不是完全匹配的,因为“(”与“]”不能匹配,而且多了一个“)”,即缺少一个与“)”相匹配的“(”. 函数ifmatched (char expr[])的功能是用栈来判断表达式中的括号是否匹配,表达式以字符串的形式存储在字符数组expr中.若表达式中的括号完全匹配,则该函数的返回值为Matched,否则返回值为Mismatched.该函数的处理思路如下:(1)设置一个初始为空的栈,从左至右扫描表达式.(2)若遇上左括号,则令其入栈;若遇上右括号,则需要与栈顶的左括号进行匹配.(3)若所遇到的右括号能与栈顶的左括号配对,则令栈顶的左括号出栈,然后继续匹配过程;否则返回Mismatched,结束判断过程.(4)若表达式扫描结束,同时栈变为空,则说明表达式中的括号能完全匹配,返回Matched. 函数ifMatched中用到了两种用户自定义数据类型BOOL 和STACK,其中,BOOL类型的定义如下:typedef enum {Mismatched, Matched}BOOL;STACK(即栈类型)的定义省略,栈的基本操作的函数原型说明如下:void InitStack(STACK *S):初始化一个空栈.void Push(STACK *S,char e):将一个字符压栈,栈中元素数目增1.void Pop(STACK *S):栈顶元素出栈,栈中元素数目减1.char Top(STACK S):返回非空栈S的栈顶元素值,栈中元素数目不变.int IsEmpty(STACK S):若S是空栈,则返回1,否则返回0.(c函数)BOOL ifMatched(char expr)char*cp/cpu指向表达式中的字符STACK S;/构造一个空栈·for(cptr-exprcptrl-N0:(1(if(·cpr=C‖·cp=T‖·p(2if(·cpy‖·p-T‖if(Is Empty(s))tum Mismatched取栈顶的左括号if(*cptr)&& el=C) return Mismatched;if(cptr=]&& el=T')return Mismatched;if(cptr=)'&& el=t')return Mismatched;/栈顶的左括号出栈考if((5))retum Matchedretum Mismatched
[问答题]A股份公司委托某证券公司代理发行普通股100000股,每股面值1元,每股按1.2元的价格出售.按协议,证券公司按收入的3%计提手续费,并直接从发行收入中扣除.则A公司计入资本公积的数额为( ).
[问答题]业主委员会组织招标过程中,如何保证广大业主的知情权
[问答题]经营战略深化期的理论有哪些
[问答题](b) Ambush loaned $200,000 to Bromwich on 1 December 2003. The effective and stated interest rate for thisloan was 8 per cent. Interest is payable by Bromwich at the end of each year and the loan is repayable on30 November 2007. At 30 November 2005, the directors of Ambush have heard that Bromwich is in financialdifficulties and is undergoing a financial reorganisation. The directors feel that it is likely that they will onlyreceive $100,000 on 30 November 2007 and no future interest payment. Interest for the year ended30 November 2005 had been received. The financial year end of Ambush is 30 November 2005.Required:(i) Outline the requirements of IAS 39 as regards the impairment of financial assets. (6 marks)
[问答题]求一份专业网络推广以及营销策划.
[问答题]Wmdows XP用户管理失败怎么办
[问答题]成都银行从业资格考试报名点在哪里
[问答题]到韩国学文科怎样~
[问答题]目前国内存在的ETF品种为
[问答题]本案中,汇票的被保证人是谁?简要说明理由.如果D公司对F公司承担了保证责任,则D公司可以向谁行使追索权?简要说明理由.
[问答题]网络安全策略设计的重要内容之一是:确定当网络安全受到威胁时应采取的应急措施.当发现当前网络受到非法入侵与攻击时,所能采取的行动基本上有保护方式和跟踪方式等两种方案.请简要说明什么情况适用于采用跟踪方式的安全策略(试举出3种情况).
[问答题]接地和接零按其作用分为四种方式,请说出哪四种
[问答题]炭疽病的主要临床特征除表现的高热和呼吸困难外,还有哪两个典型症状
[问答题]读图回答拉萨和重庆哪个地区更适宜发展太阳能,并结合两地自然条件分别说明理由.
[问答题]张老师.女,45岁.喜欢吃各种甜食和巧克力、炸薯条等热量高的食品.平时基本上没有户外运动的习惯.体格测量结果为:身高165cm,体重80kg,腰围90cm,臀围11Ocm.请根据上述案例回答以下问题.(1)张老师的BMI是多少?按标准是否正常(2)除了BMI外,还可以通过哪些指标反映上述判断情况
[问答题]阅读以下说明和JAVA 2代码,填入(n)处.[说明]以下JAVA程序设计了类CSet,使用同一个名称(set)的method来传入数据.仔细阅读[代码6-1)、[代码6-2]和[代码6-3]和相关注释,将程序补充完整.[代码6-1]import java.io.*;class CSet{private int width;private int height;(1)public void set(String color){col=color; //(a)可输入长方形的颜色}public void set (iht w, int h){width=w; //(b)可输入长方形的宽和高height=h;}public void set (String color, int w, int h){col=color; //(c)可输入长方形的颜色、宽和高width=w;height=h;}public void show ( ){System.out.println (n\长方形的颜色为: +col);System.out.println (n\长方形宽为: +width+ 长方形高为: +height);}}[代码6-2]public class hw8_3{public static void main (String args[]) throws IOException{intw, h; //声明宽、长变量,并给予赋值String color, k;CSet rect1;rect1=new CSet ( );System.out.print (\n请输入颜色:: );color=input ( );System.out.print (请输入宽度:: );k=input ( );w=Integer.parseInt (k);System.out.print (请输入高度:: );k=input( );h=Integer.parseInt (k);(2)//设置长方形的颜色(3)//设置长方形的宽、高rectl.show ( );(4)//设置长方形的颜色和宽、高rectl.show ( );}[代码6-3]public static String input( ) throws IOException//输入函数{String str;BufferedReader buf;(5)str=buf.readLine ( )return str;}}
[问答题](b) You are an audit manager in a firm of Chartered Certified Accountants currently assigned to the audit of CleevesCo for the year ended 30 September 2006. During the year Cleeves acquired a 100% interest in Howard Co.Howard is material to Cleeves and audited by another firm, Parr & Co. You have just received Parr’s draftauditor’s report for the year ended 30 September 2006. The wording is that of an unmodified report except forthe opinion paragraph which is as follows:Audit opinionAs more fully explained in notes 11 and 15 impairment losses on non-current assets have not beenrecognised in profit or loss as the directors are unable to quantify the amounts.In our opinion, provision should be made for these as required by International Accounting Standard 36(Impairment). If the provision had been so recognised the effect would have been to increase the loss beforeand after tax for the year and to reduce the value of tangible and intangible non-current assets. However,as the directors are unable to quantify the amounts we are unable to indicate the financial effect of suchomissions.In view of the failure to provide for the impairments referred to above, in our opinion the financial statementsdo not present fairly in all material respects the financial position of Howard Co as of 30 September 2006and of its loss and its cash flows for the year then ended in accordance with International Financial ReportingStandards.Your review of the prior year auditor’s report shows that the 2005 audit opinion was worded identically.Required:(i) Critically appraise the appropriateness of the audit opinion given by Parr & Co on the financialstatements of Howard Co, for the years ended 30 September 2006 and 2005. (7 marks)