得到
  • 汉语词
  • 汉语典q
当前位置 :
求代码ACMLC-DisplayAfriendofyouhasjustboughtanewcomputer.Untilnow,themostpowerfulcomputerheeverusedhasbeenapocketcalculator.Now,lookingathisnewcomputer,heisabitdisappointed,becausehelikedtheLC-displayofhiscalc
1人问答
问题描述:

求代码ACMLC-Display

Afriendofyouhasjustboughtanewcomputer.Untilnow,themostpowerfulcomputerheeverusedhasbeenapocketcalculator.Now,lookingathisnewcomputer,heisabitdisappointed,becausehelikedtheLC-displayofhiscalculatorsomuch.SoyoudecidetowriteaprogramthatdisplaysnumbersinanLC-display-likestyleonhiscomputer.

Input

Theinputcontainsseverallines,oneforeachnumbertobedisplayed.Eachlinecontainstwointegerss,n(1≤s≤10,0≤n≤99,999,999),wherenisthenumbertobedisplayedandsisthesizeinwhichitshallbedisplayed.

Theinputfilewillbeterminatedbyalinecontainingtwozeros.Thislineshouldnotbeprocessed.

Output

OutputthenumbersgivenintheinputfileinanLC-display-styleusings"-"signsforthehorizontalsegmentsands"|"signsfortheverticalones.Eachdigitoccupiesexactlys+2columnsand2s+3rows.(Besuretofillallthewhitespaceoccupiedbythedigitswithblanks,alsoforthelastdigit.)Therehastobeexactlyonecolumnofblanksbetweentwodigits.

Outputablanklineaftereachnumber.(Youwillfindasampleofeachdigitinthesampleoutput.)

SampleInput

212345

367890

00

SampleOutput

------

||||||

||||||

--------

|||||

|||||

------

---------------

||||||||

||||||||

||||||||

---------

||||||||

||||||||

||||||||

------------

自己写的?

宋莉莉回答:
  #include   usingnamespacestd;   charn1[]="--------";   charn2[]="||||||";   charn3[]="||||||||";   charn4[]="-------";   charn5[]="||||";   charn6[]="|||||||||";   charn7[]="-------";   intmain()   {   intm;   charn[10];   cin>>m>>n;   while((n[0]-'0')||m)   {   intlen=strlen(n);   for(inti=0;i
字乐句网(zileju.com)汇总了汉语字典,新华字典,成语字典,组词,词语,在线查字典,中文字典,英汉字典,在线字典,康熙字典等等,是学生查询学习资料的好帮手,是老师教学的好助手。
声明:本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。

邮箱:  联系方式:

Copyright©2009-2021 字乐句网 zileju.com 版权所有