问题 填空题

下列程序的功能是找出被5和7除余数为1的最小的5个正整数。请在程序空白处填入适当的语句,使程序可以完成指定的功能。
Private Sub Form_Click()
Dim Ncount%,n%
Ncount=0
n=0
Do
n=n+1
If______Then
Debug.Print n
Ncount=Ncount+1
End If
Loop Until Ncont=5
End Sub

答案

参考答案:n Mod 5=1 And n Mod 7=1

解析: 本题考查的是VBA编程基础。题目要求在显示出最小的5个可以同时被5和7除后余1的整数。Do…loop until Ncount=5循环进行整体控制,n=n+1保证是最小的5个正整数。而if控制的两个语句,一个是打印,一个是对找出的数进行计数。因此,if的条件必定是满足要求的一条语句,要满足这个条件,必须满足两个条件,一是n mod 5=1,二是n mod 7=1,且要同时满足,则可用and进行连接。

单项选择题
单项选择题

Washington, DC has traditionally been an unbalanced city when it comes to the life of the mind. It has great national monuments, from the Smithsonian museums to the Library of Congress. But day-to-day cultural life can be thin. It attracts some of the country’s best brains. But far too much of the city’s intellectual life is devoted to the minutiae of the political process. Dinner table conversation can all too easily turn to budget reconciliation or social security.

This is changing. On October 1st the Shakespeare Theatre Company opened a 775-seat new theatre in the heart of downtown. Sidney Harman hall not only provides a new stage for a theatre company that has hitherto had to make do with the 450-seat Lansburgh Theatre around the corner. It will also provide a platform for many smaller arts companies.

The fact that so many of these outfits are queuing up to perform is testimony to Washington’s cultural vitality. The recently-expanded Kennedy Centre is by some measures the busiest performing arts complex. But it still has a growing number of arts groups which are desperate for mid-sized space down- town. Michael Kahn, the theatre company’s artistic director, jokes that, despite Washington’s aversion (厌恶) to keeping secrets, it has made a pretty good job of keeping quiet about its artistic life. The Harman Centre should act as a whistle blower.

Washington still bows the knee to New York and Chicago when it comes to culture. But it has a good claim to be America’s intellectual capital. It has the greatest collection of think-tanks on the planet, and it regularly sucks in a giant share of the country’s best brains. Washington is second only to San Francisco for the proportion of residents twenty-five years and older with a bachelor’s degree or higher.

Washington’s intellectual life has been supercharged during the Bush years, despite the Decider’s aversion to ideas. September 11th, 2001, put questions of global strategy at the center of the national debate. Most of America’s intellectual centers are firmly in the grip of the left-liberal establishment. For all their talk of "diversity" American universities are allergic to a diversity of ideas. Washington is one of the few cities where conservatives regularly do battle with liberals. It is also the center of a fierce debate about the future direction of conservatism.

The danger for Washington is that this intellectual and cultural renaissance will leave the majority of the citizens untouched. The capital remains a city deeply divided between over-educated white itinerants and under- educated black locals. Still, the new Shakespeare theatre is part of job-generating downtown revival. Twenty years ago downtown was a desert of dilapidated(破旧的) buildings and bag people. Today it is bustling with life. If Washington is struggling to fix the world, at least it is making a reasonable job of fixing itself.

Which of the following is true of the text()

A. The opening of the new theatre signifies intellectual and cultural resurrection in Washington

B. Washington’s intellectual life has shown unprecedented vitality during the Bush years

C. American universities and Washington are places where there are really diverse ideas

D. Washington’s intellectual revival is one step further towards American’s global strategy