完成下面的程序,使显示结果如下图所示。
Private Sub Form_Click()
FontSize=18
Sample$s="【 】"
x=(ScaleWidth-TextWidth(Sample$))/2
y=(ScaleHeight-TextHeight(Sample$))/2
CurrentX=x
CurrentY=y
【 】Sample$
End Sub
请将下列类定义补充完整。
class Base{public:void fun(){tout<<"Base::fun"<<endl;}};
class Derived:public Base
{
public:
void fun()
{
______//显示调用基类的fun函数
cout<<"Derived::fun"<<endl;
};
下面程序的预设功能是:统计文件abc.txt中的字符个数。
include <iostream.h>
include <fstream.h>
include <stdlib.h>
void main()
{
fstream file;
file.open( "abc.txt", ios::in);
if ( !file )
{
cout<<"Can not open abc.txt"<<end1;
abort();
}
设有命令按钮Command1的单击事件过程,代码如下:
Private Sub Command1_Click()
Dim a As Integer
For i=1 To 30
a(i)=i
Next
For Each arrItem 【 】a
If arrItem Mod 7=0 Then Print arrItem;
If arritem>90 Then Exit For
Next
End Sub
请填空。
下面程序的功能是找出给定的10个数中最大的一个数,最后输出这个数以及它在原来 10个数中的位置。请在下划线处填入适当的内容,将程序补充完整。
Option Base 1
Private SubForm_Cfick()
Dim X
x=Array(23,-5,17,38,-31,46,11,8,5,-4)
Max=1
k=1
10 k=k+1
ifx(k)>x(max)then
在n个运动员中选出任意r个人参加比赛,有很多种不同的选法,选法的个数可以用公式n!/(n-r)!r!计算,下图窗体中3个文本框的名称依次是Text1、Text2、Text3。程序运行时在Text1、Text2中分别输入n和r的值,单击Command1按钮即可求出选法的个数,并显示在Text3文本框中(见下图)。请填空。
click()
Private Su