【说明】 该程序运行后,输出下面的数字金字塔 1 1 2 1 1 2 3 2 1 1 2 3 4 3 2 1 ...... 1 2 3 4 5 6 7 8 9 8 7 6 5 4 3 2 1 【程序】 #include < stdio. h > main ( ) } char max, next; int i; for( max = ’1’; max <= ’9’; max + +) { for(i=1;i<=20- (1) ;++i) printf(" "); for(next = (2) ;next <= (3) ;next ++) printf(" %c" ,next); for(next= (4) ;next>= (5) ;next--) printf(" %c" ,next); printf(" \n" ); } }
查看答案
UML提供了4种结构图用于对系统的静态方面进行可视化、详述、构造和文档化。其中 (17) 是面向对象系统建模中最常用的图,用于说明系统的静态设计视图;当需要说明系统的静态实现视图时,应该选择 (18) ;当需要说明体系结构的静态实施视图时,应该选择 (19) 。
A. 构件图
B. 类图
C. 对象图
D. 部署图
Supermarket’s New StrategyOne supermarket in Tokyo has managed to solve the problems of shoplifting, mistakes by cashiers, and long lines of customers waiting at the cash registers. It is Japan’s advanced computer technology that has come (51) with the answers.Shoppers at an OK supermarket on the outskirts of the city now push a cart (52) a plastic card chained to it and buy from glass cases where the goods are on display. The plastic card has a magnetic number imprinted on it. Each customer carries his or her own card, which is (53) at the exit. While shopping, the customer pushes the card into a slot beside whichever items are wanted and pushes a button or two. The glass covered vending machines are connected to a computer that (54) the price of every item in the store. Prices of every purchase are added up automatically. (55) she has finished shopping, the customer hands her card to a cashier who (56) it into the register. A second later the (57) pops out.Shoplifting is physically impossible. Once you touch a commodity the computer remembers it no matter how you hide it or (58) you eat it on the spot.A cashier at the OK supermarket is now able to work 15 times faster than her (59) at a conventional supermarket. Only two cashiers, (60) , are required at the store, which (61) 2,500 separate items. One man is enough to keep the vending machine filled, because whenever the stock for a certain commodity is (62) to run out, a red lamp in the computer-room (63) him.But there are disadvantages too: a customer cannot (64) his or her mind about a purchase. Once touched, the item cannot be put back. The customer must (65) a cashier with it first and get a refund later. There are also no fresh vegetables or fish on sale—everything is prepackaged. 58()。
A. before
B. when
C. even if
D. while
己知3个类O、P和Q,类O中定义了一个私有方法F1、一个公有方法F2和一个受保护的方法F3:类P和类Q是类O的派生类,其继承方式如下所示: class P:protected O …; class Q:public O …; 关于方法F1的描述中正确的是 (58) ;关于方法F2韵描述中正确的是 (59) ;在关于方法F3的描述中正确的是 (60) 。
A. 类O、P和Q的对象都可以访问方法F2
B. 类P和Q的对象都可以访问方法F2
C. 类O和Q的对象都可以访问方法F2
D. 只有在类P内才能访问方法F2
Tom enjoyed going to the movies. He especially liked seeing movies made from stories he had read in the books. He went at least once a week. He liked to sit in the same seat, but sometimes when the theater was full, this was not possible. He had to sit wherever there was an empty seat. One evening, he found himself sitting behind a man who had his arm around a large dog on the seat beside him. This was strange, but even stranger was the dog’s behaviour(举止,行为). It seemed to be watching the movie with interest, but from time to time it would turn to the man and bark quietly in his ear. The man would just nod, and the dog would turn back to watch the movie. Sometimes when something funny happened in the movie, the clog barked quite loudly and wagged(摆动) its tail. Tom sat behind the man and his dog for a long time without saying anything. He thought it would be rude to speak to them while the movie was still on. But when it came to the end and the lights in the theater went on, Tom decided to say something. He tapped the man on the shoulder. The man turned around. "Yes" he said. "What is it" "Please don’t think me rude," Tom said, "but isn’t your dog’s behaviour rather strange" "You’re right," the man agreed. "It’s strange. He hated the film.\ Tom enjoyed going to the movies. He liked to sit ______.
A. in the first of the theater
B. in different seats
C. in the same seat