首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有如下程序: #inc1ude<iostream> #inc1ude<iomanip> using namespace std; int main(){ cout<<setfill(’#’)<<setw(4)<<"OK"<<
有如下程序: #inc1ude<iostream> #inc1ude<iomanip> using namespace std; int main(){ cout<<setfill(’#’)<<setw(4)<<"OK"<<
admin
2016-11-23
24
问题
有如下程序:
#inc1ude<iostream>
#inc1ude<iomanip>
using namespace std;
int main(){
cout<<setfill(’#’)<<setw(4)<<"OK"<<123<<endl;
retum 0;
}
运行这个程序的输出结果是( )。
选项
A、##OK123
B、##OK#123
C、OK##123
D、OK##123#
答案
A
解析
setfill是设置填充字符,setw设置输出的宽度,它们的作用表现在紧接着输出的字符串上。这个宽度是填充后的宽度。所以cout<<setfill(’#’)<<setw,(4)<<"OK"<<123中,setfill和setw只作用在"OK",表示在"OK"前面填充2个≠≠撑。
转载请注明原文地址:https://kaotiyun.com/show/lzAp777K
本试题收录于:
二级C题库NCRE全国计算机二级分类
0
二级C
NCRE全国计算机二级
相关试题推荐
下列对字符数组进行初始化的语句中,正确的是()。
下列程序的运行结果为#include<iostream.h>voidprint(doublea){cout<<++a;}voidprint(inta,intb){
如果表达式x*y+2中,“*”是作为友元函数重载的,“+”是作为友元函数重载的,则该表达式还可为
已知数据表A中每个元素距其最终位置不远,为节省时间,应采用的算法是
关系模型允许定义3类数据约束,下列不属于数据约束的是
数据结构作为计算机的一门学科,主要研究数据的逻辑结构、对各种数据结构进行的运算,以及
冒泡排序算法在最好的情况下的元素交换次数为【】。
对于循环队列,下列叙述中正确的是
栈和队列的共同特点是
随机试题
酸碱物质有几级电离,就有几个突跃。()
南朝乐府民歌起东吴迄于陈,今传五百余首,大多辑人郭茂倩《乐府诗集》的________中,少部分在________、__________中。吴歌主要产生于当时首都建业(今江苏南京)一带的江南地区,是南朝的经济政治文化中心。_______则采自长江中游及汉水两
认定
A.1日 B.3日 C.5日 D.7日 E.15日为门诊患者开具的普通药品一般限
温热病后期,阴分伏热,夜热早凉,热退无汗,首选
根据支付结算法律制度的规定。下列关于经营性存款人违反账户结算的行为中,适用给予警告并处以5000元以上3万元以下罚款的是()。(2014年)
音量是由发音体振动的()决定的。
根据以下资料,回答回答下列问题。2013年,全国商品房销售面积130551万平方米,比上年增长17.3%,增速比1—11月份回落3.5个百分点,比2012年提高15.5个百分点;其中,住宅销售面积增长17.5%,办公楼销售面积增长27.9%,商业营业用房
计算机内部采用的数制是
新华网消息:印度尼西亚副总统卡拉28日透露,地震和海啸造成的该国死亡人数可能高达2.5万人。此前统计的印尼死亡人数为近5000人。负责政府救援工作的卡拉当天对印尼媒体说:“目前还没有准确的统计数字,但是我估计死亡人数在2.1万到2.5万之间。”卡拉还估计,
最新回复
(
0
)