更多"以下程序运行后,如果从键盘上输入ABCDEF<回车>,则输出结果为__"的相关试题:
[单项选择]在执行以下程序时,如果从键盘上输入ABCdef<回车>,则输出为______。
#include <stdio.h>
main ( )
char ch;
while ((ch=getchar( ))!="/n")
if (ch>=’A’&& ch<=’B’)ch=ch+32;
else if (ch>=’a’&& ch<=’z’)ch=ch-32;
printf("%c",ch);
printf("/n");
A. ABCdef
B. abcDEF
C. abc
D. DEF
[填空题]以下程序运行后输入“abcdef<回车>”,则输出结果是______。
#include<stdio.h>
#include<string.h>
void fun(char *str)
{ char temp; int n, i;
n=strlen(str);
temp=str[n-1];
for(i=n-1; i>0; i--) str[i]=str[i-1];
str[0]=temp;
}
main( )
{ char s[50];
scanf("%s", s); fun(s); printf("%s/n", s);
}
[填空题]以下程序运行后输入:4,abcdef<回车>,则输出结果是______。
#include<stdio.h>
#include<string.h>
move(char*str,int n)
{ char temp;int i;
temp=str[n-1];
for(i=n-1;i>0;i--)
str[i]=str[i-1];
str[0]=temp;
}
main( )
{ char s[50];int n,i,z;
scanf("%d,%s",&n,s);
z=strlen(s);
for(i=1;i<n;i++)
move(s,z);
printf("%s/n",s);
}
[单项选择]下列程序运行后,如果从键盘上输入ABCDE<回车>,则输出结果为______。
#include<stdio.h>
#include<string.h>
fuch (char str[] )
int num=0;
while (*(str+num)!=’/0’)num++;
return(num);
main( )
char str[10],*p=str;
gets(p);printf("%d/n",fuch(p));
A. 8
B. 7
C. 6
D. 5
[单项选择]在窗体上画一个文本框,然后编写如下事件过程。当该程序运行后,如果在键盘上输入字母e,则文本框中显示的内容为 ______。
Private Sub Text1_KeyPress(KeyAscii As Integer)
Dim char as String
char=Chr(KeyAscii)
KeyAscii=Asc(UCase(char))
Text1.Text=String(5,KeyAscii)
End Sub
A. eeeee
B. EEEEE
C. eeeeee
D. EEEEEE
[单项选择]若输入“abcdef”、“abdef”,以下程序的输出结果为( )。
#include<stdio.h>
#lnclude<string.h>
main( )
int n;
char s1[20],s2[20],p1,*p2;
scanf("%s",s1);
scanf("%s",s2);
P1=s1;
p2=s2;
n=strcmp(p1,p2);
printf("%d/n",n);
A. -1
B. 0
C. "abcdef"
D. "abdef"
[单项选择]运行以下程序后,如果从键盘上输入shose后回车,则输出结果为 _______。
# include<iostream.h>
void main( )
int v1=0,v2=0,k=0;
char ch[80];
cin>>ch;
while(ch[k])
switch(ch[k])
case ’s’;
case ’h’;
default: v1++1;
case ’o’: v2++;
k++;
cout<<v1<< ","<<v2<<end1;
A. 2, 0
B. 5, 0
C. 4, 5
D. 2, 5
[单项选择]在执行以下程序时,如果从键盘上输入:ABCdef<回车>,则输出为______。
main( ) { char ch;
while((ch=getchar( ))!=’/n’) { if(ch>=’A’
&& ch<=’Z’) ch=ch+32; else
if(ch>=’a’&&ch<=’2’)ch=ch-32;
printf("%c",ch); }
printf("/n"); }
A. ABCdef
B. abcDEF
C. abc
D. DEF
[单项选择]运行以下程序后,如果从键盘上输入65 14<回车>,则输出结果为______。
main( )
int m,n;
printf("Enter m,n:");
scanf("%d%d",&m,&n);
while(m!=n)
while(m>n)m-=n;
while(n>m)n-=m;
printf("m=%d/n",m);
A. m=3
B. m=2
C. m=1
D. m=0
[填空题]以下程序是建立一个名为myfile的文件,并把从键盘输入的字符存入该文件,当键盘上输入结束时关闭该文件。
#include
main( )
{
FILE *fp;
char c;
fp=__________;
do
{
c=getchar( );
fputs(c,fp);
}while(c!=EOF);
__________; ;
}
[单项选择]运行以下程序后,如果从键盘上输入china#<回车>,贝愉出结果为_______。
#include<stdio.h>
main( )
int v1=0,v2=O;char ch;
while((ch=getchar( ))!=’#’)
switch(ch)
case’a’:
case’h’:
default:v1++;
case’O’:v2++;
printf("%d,%d/n",v1,v2);
A. 2,0
B. 5,0
C. 5,5
D. 2,5
[填空题]以下程序的功能是:从键盘上输入若干个数字,当输入负数时结束输入,统计出若干
数字的平均值,显示结果。请填空。
Private Sub Form_click( )
Dim x,y As Single
Dim z As Integer
x=InputBox("Enter a score")
Do while 【13】
y=y+x
z=z+1
x=InputBox("Enter a score")
Loop
If z=0 Then
z=1
End If
y=y/z
msgbox y
End Sub
[填空题]以下程序运行后输入:3,abcde<回车>,则输出结果是【 】
#include <string.h>
move(char *str, int n)
{ char temp; int i;
temp=str[n-1];
for(i=n-1;i>0;i--) str[i]=str[i-1];
str[0]=temp;
}
main( )
{ char s[50]; int n, i, z;
scanf("%d,%s",&n,s);
z=strlen(s);
for(i=1; i<=n; i++= move(s, z);
printf("%s/n",s);
=