题目详情
当前位置:首页 > 职业培训考试
题目详情:
发布时间:2023-12-01 20:28:14

[填空题]下面程序的功能是将小写字母变成对应大写字母后的第二个字母。其中y变成A,z变成B。 #include "stdio.h" main( ) {char c; while((c=getchar( ))!=’/n’) {if(c>=’a’&&c<=’z’) c=c-30; if(c>’z’||c<=’z’+2) c=c-26;} printf("%c",c); } 错误:______ 改正:______

更多"下面程序的功能是将小写字母变成对应大写字母后的第二个字母。其中y变成A"的相关试题:

[填空题]下面程序的功能是将字符数组a中下标值为偶数的元素从小到大排列,其他元素不变,请填空。
#include<iostream.h>
#include<string.h>
void main( )
char a[ ] ="clanguage", t;
int I ,j, k;
k=strlen(a) ;
for(i=0;i<=k-2;i+=2)
for(j=i+2;j<=k; 9 )
if( 10 )
t=a[i] ;a[i] =a[j] ;a[j] =t;
cout < < a;
cout < < endl;
[填空题]下面程序有两个printf语句,如果第一个printf语句输出的是194,则第二个printf语句的输出结果是 【10】
main( )
int a[10]=1,2,3,4,5,6,7,8,9,0,*p;
p=a
printf("%x/n",p);
printf("%x/n",p+9);

[简答题]以下是某C程序段,其功能为计算1到所输入数字的逐步累加和,请仔细阅读程序并完成要求。
#include
int sum(int n )

int i,ret_sum;
ret_sum = 0;
for ( i = 1; i <= n; i++ )
ret_sum += i;
return ret_sum;

void main( )

int j,n;
printf("/1: Please input value here ==> ");
scanf("%d",&n);
for ( j = 1; j <= n; j++ )
printf("/2: from 1 to %d is %d/n",j,sum(j));

设计一组测试用例,使该程序所有函数的语句覆盖率和分支覆盖率均能达到100%。如果认为该程序的语句或分支覆盖率无法达到100%,需说明为什么。
[简答题]
以下是某C程序段,其功能是计算出某一天是一年中的第几天,请仔细阅读程序并完成要求。
#include
struct days
{
int year;
int month;
int date;
}day;
void main( )
{
struct days *p;
int num=0, i;
int m[13]={0,31,28,31,30,3l,30,3l,3l,30,31,30,31);
p=&day;
printf("please input the day:/n");
seanf("% d % d % d, &(p->year), &(p->month),&(p->date));
for(i=0; i<(p->month); i++)
num+=m[i];
num+=(p->date);
if((p->year)%4= =0&&(p>year)%100 !=0 || (p->year)%400==0)
if((p->>month)>2)
num++;
printf(" This day is % d day in the year./n ", num);
}
画出此程序主函数的控制流程图。

[填空题]以下程序的功能是:将输入的正整数按逆序输出。例如:若输入135则输出531。请填空。
#include <stdio.h>
main( )
int n,s;
printf("Enter a number:");scanf("%d",&n);
printf("Output:");
do
s=n%10;printf("%d",s);______;
while(n! =0);
printf("/n");

[填空题]下列程序的功能是:将输入的正整数按逆序输出。例如:若输入135则输出531。请填空。
#include<stdio.h>
main( )
int n,s;
printf("Enter a number:");scanf("%d",&n);
printf("Output:");do
s=n%10;printf("%d",s); ______;
while(n!=0);printf("/n");

[简答题]下面程序是关于类的继承的用法。阅读下面程序,根据程序中的注释在每一条横线处填写一个语句,使程序的功能完整,且运行程序后的输出结果为: I am parentclass! I am childclass! I am childclass! 注意:请勿改动main( )主方法和其他已有的语句内容,仅在下划线处填入适当的语句。 class Parent { void printMe( ) { System. out. println( "I am parentclass ! "); } } class Child extends Parent { void printMe( ) { System. out. println( "I am childclass! ") } void printAll( ) { ______. printMe( ); //调用父类的方法 ______. printMe( ); //调用本类的方法 printMe ( ); } } public class TestJieCheng { public static void main(String args[]) { ______ myC. printAll( ); } }

我来回答:

购买搜题卡查看答案
[会员特权] 开通VIP, 查看 全部题目答案
[会员特权] 享免全部广告特权
推荐91天
¥36.8
¥80元
31天
¥20.8
¥40元
365天
¥88.8
¥188元
请选择支付方式
  • 微信支付
  • 支付宝支付
点击支付即表示同意并接受了《购买须知》
立即支付 系统将自动为您注册账号
请使用微信扫码支付

订单号:

请不要关闭本页面,支付完成后请点击【支付完成】按钮
恭喜您,购买搜题卡成功
重要提示:请拍照或截图保存账号密码!
我要搜题网官网:https://www.woyaosouti.com
我已记住账号密码