更多"下列程序运行时,若输入1abcdef2df<回车>,输出结果为____"的相关试题:
[填空题]下列程序运行时,若输入1abcedf2df<回车>,则程序的输出结果为______。
#include <stdio.h>
main( )
char a=0,ch;
while((ch=getchar( ))!=’/n’)
if(a%2!=0&&(ch>=’a’&&ch<=’z’))ch=ch-’a’+’A’;
a++;putchar(ch);
printf("/n");
[填空题]下列程序运行时,若输入1abcedf2df<回车>,则输出结果为______。
#include<stdio.h>
main( )
char a=0, ch;
while((ch=getchar( ))!=’/n’)
if(a%2!=0 && (ch>=’a’ && ch<=’z’)) ch=ch-’a’+’A’;
a++; putchar(ch);
printf("/n");
[填空题]以下程序在运行时若输入:1234567,则程序的运行结果是______。
#include<stdio.h>
main( )
int x, y;
scanf("%2d%1d", &x, &y); printf("%d/n", x+y);
[填空题]有以下程序,若运行时从键盘输入:18,11<回车>,则程序的输出结果是 【9】 。
main ( )
int a, b;
printf("Enter a, b:"); scanf("%d, %d",&a,&b);
while(a!=b)
while(a>b)a-=b;
while(b>a)b-=a;
printf("%3d%3d/n",a,b);
[填空题]有以下程序,若运行时从键盘输入:18,11<回车>,则程序的输出结果是______。
main( )
int a,b;
printf("Enter a,b:");scanf("%d,%d",&a,&b);
while(a!=b)
while(a>b)a-=b;
while(b>a)b-=a;
printf("%3d%3d",a,b);
[单项选择]以下程序运行时输入:12<回车>,执行后输出结果
#include<stdio.h>
main( )
char ch1,ch2;int n1,n2;
ch1=getchar( );ch2=getchar( );
n1=ch1-’0’;n2=n1*10+(ch2-’0’);
printf("%d/n",n2);
[填空题]以下程序运行后,若输入:3,abcde <回车>,则输出结果是 【11】 。
#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);
}
[填空题]以下程序运行时若从键盘输入:10 20 30<回车>,输出结果是 。
# include<stdio.h>
main( )
int i=0,j=0,k=0;
scanf("%d% *d%d",&i,&j,&k);printf("%d %d %d//n",i,j,k);
[填空题]以下程序运行时若从键盘输入:10 20 30<回车>,输出结果是 【10】 。
# include<stdio.h>
main( )
int i=0,j=0,k=0;
scanf("%d% *d%d",&i,&j,&k);printf("%d %d %d/n",i,j,k);
[单项选择]下面的程序运行时,若输入“Visual Basic Programming”,则在窗体上输出的是
Private Sub Command1_Click( )
Dim count(25) As Integer, ch As String
ch=Uease(InputBox("请输入字母字符串"))
For k=1 To Len(eh)
n=Asc(Mid(ch, k, 1))-Asc("A")
If n>0 Then
Count(n)=Count(n)+1
End If
Next k
m=Count(0)
For k=1 To 25
If m<count(k) Then
m=count(k)
End If
Next k
Print m
End Sub
A. 0
B. 1
C. 2
D. 3
[单项选择]下面程序运行时,若输入“Visual Basic Programming”,则在窗体上输出的是( )。
Private Sub Command1 Click( )
Dim Num(25)As Integer,Chr1 As String
Chr1=UCase(InputBox("请输入字母字符串"))
For k=1 To Len(Chr1)
n=Asc(Mid(Chr1,k,1))-Asc("A")
If n>=0 Then
Num(n)=Num(n)+1
End If
Next k
m=Num(0)
Fork=1 To 25
If m<Num(k)Then
m=Num(k)
End If
Next k
Print m
End Sub
A. 3
B. 2
C. 1
D. 0
[填空题]以下程序运行时若从键盘输入:10 20 30<回车>。输出结果是 【6】 。
#include <stdio.h>
main( )
int i=0,j=0,k=0;
scanf("%d%*d%d",&i,&j,&k);
printf("%d %d %d/n",i,j,k);
[填空题]在以下程序运行时若从键盘输入:10 20 30<回车>。输出结果是______。
#include<stdio.h>
main( )
int i=0,j=0,k=0;
scanf("%d%*d%d",&i,&j,&k);
printf("%d%d%d/n",i,j,k);
[填空题]以下程序运行时若从键盘输入:10 20 30<回车>。输出结果是______。
#include<stdio.h>
main( )
int i=0,j=0,k=0;
scanf("%d%*d%d",&i,&j,&k);printf("%d%d%d/n",i,j,k);