假定有以下函数过程:
Function Fun(S As String)As String
Dim sl As String
Fori=1 ToLen(S)
sl=Lease(Mid(S,i,1))+s1
Nexti
Fun=s1
End Function
在窗体上画一个命令按钮,然后编写如下事件过程:
Private Sub Commandl Click(、
Dim Str1 As String.Str2 As String
Strl=InputBox(”请输入一个字符串”)
Stf2=Fun(Strl)
Print Str2
End Sub
程序运行后,单击命令按钮,如果在输入对话框中输入字符串“abcdefg”,则单击“确定”按钮后在窗体上的输出结果为
A.ABCDEFG
B.abcdefg
C.GFEDCBA
D.gfedcba
第1题:
假定有以下函数过程: Function Fun(S As String)As String Dimsl As String Fori=1 To Len(S) s1=UCase(Mid(S,i,1))+s1 Nexti Fun=s1 End Function 在窗体上画一个命令按钮,然后编写如下事件过程: Private Sub Commandl_Click() DimStrl As String,Str2 As Str
A.abcdefg
B.ABCDEFG
C.gfedcba
D.GFEDCBA
第2题:
若有定义语句:
char}sl=‘’0K”,:It s2=”ok”;
以下选项中,能够输出“OK”的语句是( )。
A.if(strcmp(sl,s2)!=0)puts(s2);
B.if(strcmp(sl,s2)!=0)puts(s1);
C.if(strcmp(sl,s2)==1)puts(s1);
D.if(strcmp(sl,s2)==0)puts(s1);
第3题:
输入hello↙,写出下面程序的运行结果。 #include <stdio.h> #include <string.h> int main() { char s[80],t[200]; int i,sl ; gets(s); sl = strlen(s); for(i=0 ;i<sl ;i++) t[i]=s[sl-i-1] ; for (i=0; i<sl; i++) t[sl+i] = s[i]; t[sl+i]='0' ; puts(t); return 0; }
第4题:
假定有以下函数过程:Function Fun(S As String)As StringDim Sl AS StringFor i=1 TO Len(S)sl=UCase(Mid(S,i,1))+slNext iFun=s1End Function则Str2= Fun("abcdefg")的输出结果为( )。A. abcdefg B.ABCDEFGC.gfedcba D.GFEDCBA
第5题:
以下程序的输出结果是_______。 #include<stdio.h> #include<string.h> fun(char*w,int n) { char t,*s1,*s2; s1=w;s2=w+n-1; while(s1<s2) { t=*s1++: *sl=*s2-; *s2=t; } } main() { char*p; p="1234567"; fun(p,strlen(p)); puts(p); }
A.1234567
B.7654321
C.1711717
D.7177171