首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有如下程序: #inc1ude<iostream> using namespace.std; int main() { cout.fill(’*’); cout.width(6); cout.fill
有如下程序: #inc1ude<iostream> using namespace.std; int main() { cout.fill(’*’); cout.width(6); cout.fill
admin
2016-11-23
25
问题
有如下程序:
#inc1ude<iostream>
using namespace.std;
int main()
{
cout.fill(’*’);
cout.width(6);
cout.fill(’#’);
cout<<123<<end1;
retum 0;
}
执行后的输出结果是( )。
选项
A、###l23
B、123###
C、***l23
D、123***
答案
A
解析
此题考查的是I/O格式化输出。函数width(int n)设置输入输出宽度,当实际数据宽度小于制定的宽度时,多余的位置用填充字符填满:当实际数据宽度大于设置的宽度时,仍按实际宽度输出:函数fill(char c)用来设置填充字符。
转载请注明原文地址:https://jikaoti.com/ti/LZt0FFFM
本试题收录于:
二级C题库NCRE全国计算机二级分类
0
二级C
NCRE全国计算机二级
相关试题推荐
单个用户使用的数据视图的描述称为
【】是C++语言程序的入口。
为了便于对照检查,测试用例应由输入数据和预期的【】两部分组成。
执行下面的程序段后,变量k的值为()。intk=3,s[2];s[0]=k;k=s[1]*10;
下面程序的功能是把316表示为两个加数的和,使两个加数分别能被13和11整除,在划线处应填入的选项是#include<iostream.h>voidmain(){
已知有定义constintD=5;inti=1;doublef=0.32;charc=15;则下列选项错误的是
关系模型允许定义3类数据约束,下列不属于数据约束的是
数据库、数据库系统和数据库管理系统之间的关系是
以下不属于对象的基本特点的是
数据结构作为计算机的一门学科,主要研究数据的逻辑结构、对各种数据结构进行的运算,以及
随机试题
为了将制作完成的幻灯片发布到Web,应该()。
A.皮肤、黏膜灼伤B.皮肤、巩膜黄染C.皮肤、黏膜发绀D.皮肤、黏膜苍白硝基苯中毒常引起的临床表现是
腹部肿瘤腹腔镜分期的突出优点是
善治暑湿或湿温初起的药物是( )。善治风寒挟湿表证的药物是( )。
对承包单位提交的《工程临时延期申请表》,监理工程师应对工期索赔进行审核以后签署《工程最终延期审批表》做出答复。
根据《建设工程安全生产管理条例》及相关法规、规章的规定,下列有关安全生产责任的说法正确的有()。
下列各项中不参与集体谈判的是()。
农村士地承包经营纠纷解决的途径有:双方当事人协商解决,请求村民委员会、乡(镇)人民政府等调解解决,向农村土地承包仲裁机构申请仲裁,向人民法院起诉等。()
为了维持顾客的进度,在圣诞节和新年之间需要一定量的加班,许多项目组成员已申请在这段时间度假,你应该()。
WelcomeSpeech1.Roomallocation.RoomnumberThebeginningletterreferstothethree【T1】________ofthecollege
最新回复
(
0
)