java实现星星图形的输出

2020年9月5日 12:17 by scott

java

最近在看阿拓老师的视频,有个输出如下图形的练习:

经过一番探索,发现一个完全用循环实现的方法:

public class star{
    public static void main(String[] args){
        for(int i=1;i<=4;i++){
            //定义三个变量
            int l=1; // left
            int m=1; // middle
            int r=1; // right
            // 画左边的星星
            for(;l<=(4-i+1);l++){
                System.out.print("*");
            }   
            //System.out.println("l:"+l);
            // 画中间的#
            for(;m<=(2*i-3);m++){
                System.out.print("#");
            }
            //System.out.println("m:"+m);
            // 画右边的星星
            for(;r<=(7-(l-1+m-1));r++){
                System.out.print("*");
            }
            //System.out.println("r:"+r);
            System.out.println();
        }
    }
}

老师给出答案是第一行特殊处理,其他行按规律输出。其实完全放在一起也是有规律的。

在此做个记录,欢迎大家批评指导!


Comments(128) Add Your Comment

Charlesnag
“I haven’t seen you in these parts,” the barkeep said, sidling during to where I sat. “Repute’s Bao.” He stated it exuberantly, as if solemn word of honour of his exploits were shared by way of settlers hither many a verve in Aeternum. He waved to a unanimated butt upset us, and I returned his indication with a nod. He filled a telescope and slid it to me across the stained red wood of the court prior to continuing. “As a betting houseman, I’d be willing to wager a fair portion of coin you’re in Ebonscale Reach in search more than the carouse and sights,” he said, eyes glancing from the sword sheathed on my with it to the bow slung across my back. https://www.google.gp/url?sa=i&rct=j&q=&esrc=s&source=images&cd=&cad=rja&uact=8&ved=0ahUKEwj7ktPYpdjUAhWETSYKHRWUA5MQjRwIBw&url=https://renewworld.ru/otlichie-new-world-versii-deluxe-i-standart-edition/
Kevingaw
https://kommstdu-hierher.de/wp-includes/inc/welches_casino_spielt_knossi_.html http://die-fototasse.de/wp-content/plugins/element/welches_online_casino_ist_zu_empfehlen___1.html https://www.rettenberger.com/typo3_src-8.7.20/typo3/robots/welches_casino_zahlt_am_schnellsten_aus____casino_f_r_echtes_geld.html http://pinup-fashion.de/wp-content/pages/welche_online_casinos_sind_in_deutschland_legal_.html https://www.simacek.com/present/inc/wie_man_ein_casino_online_schl_gt__clevere_tipps_f_r_anf_nger_und_erfahrene_spieler.html
Kevingaw
http://www.google.ee/url?sa=i&rct=j&q=&esrc=s&source=images&cd=&docid=2l_o-24g-_akkm&tbnid=wdqervrukes26m:&ved=0cacqjrw&url=http://pinup-fashion.de/wp-content/pages/welche_online_casinos_sind_in_deutschland_legal_.html https://nething.com/wp-includes/pages/?wie_man_an_casino_spielautomaten_gewinnt_und_spielautomaten_richtig_spielt__schemata_und_strategien.html https://maps.google.se/url?q=http://dolce-vita.com/wp-content/pages/welche_kasinos_gewinnen_.html https://schlossgut.de/news/welche_online_casinos_sind_in_deutschland_legal__1.html https://www.karl-georg.de/tmp/welches_casino_zahlt_am_schnellsten_aus______die_ehrlichsten_vertrauensw_rdigen_casinos.html
Jnegtg
lipitor for sale <a href="https://lipiws.top/">atorvastatin 20mg oral</a> lipitor 40mg drug
Usgfvg
ciprofloxacin online order - <a href="https://cipropro.top/">cipro without prescription</a> amoxiclav oral
Mitzog
how to get cipro without a prescription - <a href="https://metroagyl.top/azithromycin/">buy amoxiclav online</a> buy amoxiclav pill
Ggcplq
purchase flagyl generic - <a href="https://metroagyl.top/cefaclor/">cefaclor 500mg cost</a> buy azithromycin without a prescription
Oouyae
ciprofloxacin 500 mg us - <a href="https://septrim.top/chloromycetin/">where to buy chloramphenicol without a prescription</a> order erythromycin for sale
Skefec
buy valtrex generic - <a href="https://gnantiviralp.com/vermox/">buy vermox 100mg pill</a> acyclovir 400mg drug
Gmkojt
generic stromectol online - <a href="https://keflexin.top/aczone/">buy aczone online</a> tetracycline oral
Ulhhdd
metronidazole 400mg price - <a href="https://metroagyl.top/azithromycin/">order azithromycin 500mg online cheap</a> azithromycin for sale online
Wqjuei
ampicillin buy online <a href="https://ampiacil.top/penicillinused/">penicillin order online</a> buy amoxicillin
Pjwegg
purchase lasix generic - <a href="https://antipathogenc.com/capoten/">buy captopril pill</a> buy capoten 25mg pill
Iiyrzz
order metformin 500mg - <a href="https://gnantiacidity.com/lincocin/">buy cheap generic lincomycin</a> buy lincocin 500 mg generic
Ovifhc
pill zidovudine - <a href="https://canadiangnp.com/allopurinol/">where to buy zyloprim without a prescription</a> allopurinol generic
Owwrjf
clozapine 100mg ca - <a href="https://genonlinep.com/pepcid/">buy pepcid without prescription</a> buy generic pepcid 20mg
Jjqers
order seroquel 50mg for sale - <a href="https://gnkantdepres.com/">quetiapine cheap</a> generic eskalith
Wnltmu
anafranil cost - <a href="https://antdeponline.com/">cheap anafranil 25mg</a> brand doxepin 75mg
Hsltvm
hydroxyzine for sale online - <a href="https://antdepls.com/prozac/">order fluoxetine sale</a> purchase endep online cheap
Kuhcot
buy clavulanate pills for sale - <a href="https://atbioinfo.com/">purchase augmentin generic</a> buy cheap generic cipro
Vledqt
buy cheap generic amoxicillin - <a href="https://atbioxotc.com/">amoxil buy online</a> order cipro pills
Nxzdtr
buy generic cleocin 150mg - <a href="https://cadbiot.com/">buy cleocin 300mg without prescription</a> chloramphenicol generic
Icsxrs
azithromycin without prescription - <a href="https://gncatbp.com/">cost zithromax 500mg</a> buy ciplox 500mg online cheap
Lztttt
buy stromectol 3mg - <a href="https://antibpl.com/tylquin/">order levofloxacin for sale</a> purchase cefaclor capsules
Pioyfd
oral albuterol - <a href="https://antxallergic.com/dftheo-24/">buy generic theo-24 Cr online</a> order theophylline 400mg pills
Qtiszk
buy methylprednisolone 16mg - <a href="https://ntallegpl.com/">buy depo-medrol tablets</a> buy astelin medication
Rgzfap
desloratadine ca - <a href="https://rxtallerg.com/getzaditor/">cost zaditor 1mg</a> ventolin 4mg ca
Demvub
micronase 5mg generic - <a href="https://prodeprpl.com/dapagliflozin5/">pill dapagliflozin</a> dapagliflozin 10 mg cost
Pvzbpm
order generic repaglinide - <a href="https://depressinfo.com/">repaglinide price</a> jardiance 25mg ca
Vidhkp
glucophage price - <a href="https://arxdepress.com/sitagliptin50/">januvia cost</a> acarbose price
Sflsik
terbinafine generic - <a href="https://treatfungusx.com/">lamisil 250mg drug</a> grifulvin v brand
Syqxpe
buy semaglutide 14 mg online - <a href="https://infodeppl.com/ddavpspray/">buy DDAVP for sale</a> how to get desmopressin without a prescription
Yqrynn
order nizoral for sale - <a href="https://antifungusrp.com/butenafinecream/">purchase mentax generic</a> sporanox 100mg pill
Xvwlwc
order famciclovir 500mg pill - <a href="https://amvinherpes.com/gnvalaciclovir/">purchase valaciclovir pill</a> purchase valaciclovir
Okdchd
order digoxin 250 mg online cheap - <a href="https://blpressureok.com/">oral digoxin</a> buy lasix 100mg pills
Grcldg
hydrochlorothiazide pill - <a href="https://norvapril.com/amlodipine/">order amlodipine 5mg generic</a> how to get zebeta without a prescription
Ihnctw
buy metoprolol 100mg online - <a href="https://bloodpresspl.com/telmisartan/">micardis 20mg without prescription</a> nifedipine canada
Zkzvzx
nitroglycerin drug - <a href="https://nitroproxl.com/">nitroglycerin pill</a> order diovan
Kwtzyd
rosuvastatin photograph - <a href="https://antcholesterol.com/">rosuvastatin nervous</a> caduet online river
Uzqvfq
zocor rise - <a href="https://canescholest.com/">simvastatin beside</a> lipitor member
Abkvnn
viagra professional online work - <a href="https://edsildps.com/malegra/">malegra material</a> levitra oral jelly online threaten
Qacmek
priligy dispose - <a href="https://promedprili.com/viagraplus/">viagra plus harmony</a> cialis with dapoxetine favour
Xulfok
cenforce neck - <a href="https://xcenforcem.com/kamagrasildenafil/">kamagra pills wife</a> brand viagra pills ghost
Nbwiln
brand cialis sweet - <a href="https://probrandtad.com/tadorapills/">tadora ford</a> penisole equipment
Apommc
cialis soft tabs online dozen - <a href="https://supervalip.com/viagraoraljelly/">viagra oral jelly pretend</a> viagra oral jelly pity
Cirzir
brand cialis follow - <a href="https://probrandtad.com/">brand cialis relate</a> penisole deserve
Icthiw
cialis soft tabs online play - <a href="https://supervalip.com/tadarisepills/">tadarise unicorn</a> viagra oral jelly prey
Rzyaov
cenforce restore - <a href="https://xcenforcem.com/levitraprofessional/">levitra professional pills student</a> brand viagra lazy
Wytbdo
acne treatment north - <a href="https://placnemedx.com/">acne medication granny</a> acne treatment coffee
Yjurmj
asthma medication earth - <a href="https://bsasthmaps.com/">asthma treatment angel</a> asthma treatment sway
Cpvrrh
uti medication confusion - <a href="https://amenahealthp.com/">uti medication jet</a> treatment for uti tom
Qveznr
prostatitis medications hasty - <a href="https://xprosttreat.com/">pills for treat prostatitis weapon</a> prostatitis medications chuckle
Yxyqgt
valacyclovir pills fry - <a href="https://gnantiviralp.com/">valacyclovir online link</a> valtrex pills dress
Lvrmoo
claritin otherwise - <a href="https://clatadine.top/">loratadine accurate</a> claritin pills star
Ffqenc
dapoxetine hill - <a href="https://prilixgn.top/">dapoxetine accept</a> priligy steward
Jzwzup
claritin pills sharp - <a href="https://clatadine.top/">claritin creep</a> claritin pills hungry
Crzmgs
ascorbic acid risk - <a href="https://ascxacid.com/">ascorbic acid sport</a> ascorbic acid young
Sppyjt
promethazine french - <a href="https://prohnrg.com/">promethazine display</a> promethazine lane
Mxopee
fludrocortisone gun - <a href="https://gastroplusp.com/nexesomeprazole/">nexium pills ford</a> prevacid rifle
Gedgup
buy rabeprazole pills - <a href="https://gastrointesl.com/metoclopramide/">buy metoclopramide 10mg online</a> domperidone 10mg oral
Zsmcio
cheap bisacodyl 5mg - <a href="https://gastroinfop.com/loperamide/">buy generic loperamide</a> purchase liv52
Hwhwkh
buy bactrim 480mg pills - <a href="https://tobmycin.com/">order generic tobramycin</a> buy tobrex for sale
Bfxkgg
hydroquinone creams - <a href="https://cerazestrel.com/">cheap desogestrel 0.075mg</a> buy duphaston 10 mg generic
Wzxowm
dapagliflozin price - <a href="https://sineqpin.com/">order sinequan for sale</a> precose ca
Ifqwnp
fulvicin without prescription - <a href="https://gemfilopi.com/">purchase gemfibrozil</a> order lopid 300 mg without prescription
Yywasi
dramamine online order - <a href="https://prasilx.com/">buy generic prasugrel 10mg</a> buy generic risedronate for sale
Exccxo
buy cheap generic enalapril - <a href="https://vasolapril.com/">buy enalapril for sale</a> order generic zovirax
Oeolou
buy monograph 600 mg generic - <a href="https://etodograph.com/">buy monograph generic</a> buy generic pletal 100 mg
Drhuiq
buy generic piroxicam 20mg - <a href="https://rivastilons.com/">buy exelon 6mg for sale</a> buy rivastigmine medication
Ppklak
buy nootropil 800mg online - <a href="https://nootquin.com/praziquantel/">where can i buy praziquantel</a> order sinemet 20mg without prescription
Njblmr
purchase hydrea - <a href="https://hydroydrinfo.com/indinavir/">oral indinavir</a> cheap methocarbamol 500mg
Jvwijs
oral divalproex 500mg - <a href="https://adepamox.com/acetazolamide/">generic diamox</a> buy topiramate online
Pwcvfd
buy norpace tablets - <a href="https://anorpica.com/lamivudine/">buy lamivudine 100 mg pills</a> how to get chlorpromazine without a prescription
Lwrfsk
buy cytoxan for sale - <a href="https://cycloxalp.com/dimenhydrinate/">how to buy dimenhydrinate</a> buy generic vastarel
Icelas
spironolactone pills - <a href="https://aldantinep.com/dipyridamole/">buy dipyridamole for sale</a> buy naltrexone 50mg for sale
Docovw
how to buy cyclobenzaprine - <a href="https://abflequine.com/">purchase cyclobenzaprine pills</a> vasotec 10mg canada
Bszfgu
zofran medication - <a href="https://azofarininfo.com/procyclidine/">kemadrin price</a> order ropinirole 2mg pills
Syutgv
ascorbic acid for sale online - <a href="https://mdacidinfo.com/prochlorperazine/">prochlorperazine usa</a> cheap compro without prescription
Clcozm
buy durex gel for sale - <a href="https://xalaplinfo.com/">order durex gel cheap</a> latanoprost price
Rftwzj
rogaine drug - <a href="https://mdacidinfo.com/dutasteride/">order dutas</a> buy finpecia online cheap
Zmyanc
buy generic arava for sale - <a href="https://infohealthybones.com/calciumcarbonate/">where to buy calcium carbonate without a prescription</a> cartidin price
Xuilwn
tenormin 100mg uk - <a href="https://heartmedinfox.com/carvedilol/">buy generic carvedilol</a> coreg 25mg generic
Thcvcr
calan buy online - <a href="https://infoheartdisea.com/cardizem/">diltiazem price</a> cheap tenoretic for sale
Hqiuhj
purchase atorvastatin online cheap - <a href="https://infoxheartmed.com/lisinopril/">generic zestril</a> nebivolol 20mg uk
Oklpwh
order lasuna - <a href="https://infoherbalmz.com/">lasuna sale</a> generic himcolin
Mavept
buy noroxin online - <a href="https://gmenshth.com/confido/">cheap confido tablets</a> buy generic confido online
Clhwkp
buy generic finasteride - <a href="https://finmenura.com/alfuzosin/">uroxatral 10mg cost</a> order alfuzosin 10mg generic
Szvwnh
speman usa - <a href="https://spmensht.com/finasteride/">buy fincar without a prescription</a> order fincar
Wcmpop
cost hytrin 5mg - <a href="https://hymenmax.com/dutasteride/">how to get avodart without a prescription</a> order priligy 60mg for sale
Ywhzms
generic trileptal 600mg - <a href="https://trileoxine.com/levothyroxine/">cheap generic levothroid</a> levothroid brand
Qmnrwh
imusporin ca - <a href="https://asimusxate.com/gloperba/">how to buy colcrys</a> brand colchicine
Zfypjz
buy lactulose online cheap - <a href="https://duphalinfo.com/mentat/">brahmi pills</a> order betahistine 16 mg pill
Wgafdc
order calcort generic - <a href="https://lazacort.com/">deflazacort oral</a> purchase alphagan sale
Nwvqnt
buy besivance medication - <a href="https://besifxcist.com/carbocysteine/">purchase carbocysteine for sale</a> sildamax over the counter
Orenil
order gabapentin 100mg online - <a href="https://aneutrin.com/ibuprofen/">ibuprofen 600mg us</a> sulfasalazine 500 mg cheap
Kkzgfz
benemid 500mg usa - <a href="https://bendoltol.com/">generic probenecid</a> carbamazepine 200mg tablet
Tdqxrk
purchase celebrex generic - <a href="https://celespas.com/indomethacin/">cheap indomethacin</a> indocin 50mg over the counter
Nuvhxr
order colospa 135 mg pills - <a href="https://coloxia.com/">order colospa 135mg generic</a> order cilostazol 100mg generic
Lbetuf
buy diclofenac online - <a href="https://dicloltarin.com/">cambia over the counter</a> cheap aspirin
Xpclxs
cheap rumalaya pills - <a href="https://rumaxtol.com/shallaki/">buy shallaki cheap</a> order endep 50mg
Irlpys
buy mestinon 60 mg - <a href="https://mestonsx.com/azathioprine/">buy imuran 25mg pills</a> azathioprine medication
Cnbqgg
baclofen online - <a href="https://baclion.com/">order baclofen pills</a> piroxicam ca
Vadqux
order diclofenac sale - <a href="https://vovetosa.com/tisosorbide/">order isosorbide 20mg for sale</a> nimodipine online order
Pckzvq
buy generic cyproheptadine 4mg - <a href="https://periheptadn.com/">cyproheptadine for sale online</a> zanaflex us
Lhpisd
purchase meloxicam pills - <a href="https://meloxiptan.com/rtrizatriptan/">order toradol 10mg online</a> toradol order
Actusx
omnicef price - <a href="https://omnixcin.com/">omnicef 300mg pill</a> cleocin order
Izsofd
buy artane for sale - <a href="https://voltapll.com/diclofenacgel/">purchase cheap diclofenac gel</a> how to order voltaren gel
Jisipm
accutane 10mg over the counter - <a href="https://aisotane.com/">isotretinoin 10mg us</a> buy deltasone 10mg sale
Gjncjz
buy deltasone 40mg generic - <a href="https://apreplson.com/">buy deltasone 10mg generic</a> cost permethrin
Zujxlk
permethrin over the counter - <a href="https://actizacs.com/asbenzac/">buy benzac for sale</a> order retin cream generic
Ztswbw
betamethasone ca - <a href="https://betnoson.com/awdifferin/">adapalene cost</a> purchase monobenzone online
Vnsrow
order flagyl 400mg generic - <a href="https://cenforcevs.com/">buy cenforce tablets</a> generic cenforce
Bvhrsn
amoxiclav order - <a href="https://baugipro.com/">augmentin sale</a> cost synthroid 150mcg
Cvfdab
cozaar medication - <a href="https://acephacrsa.com/">purchase keflex</a> cephalexin generic
Ycgmhp
buy generic clindamycin online - <a href="https://indometnp.com/">buy indomethacin 50mg generic</a> buy indomethacin sale
Hpcbyc
purchase eurax cream - <a href="https://aeuracream.com/caczone/">buy aczone</a> buy cheap aczone
Vdiyex
order provigil 100mg pills - <a href="https://sleepagil.com/">buy provigil 100mg sale</a> where to buy meloset without a prescription
Wkuldl
brand zyban - <a href="https://bupropsl.com/shuddhaguggulu/">oral shuddha guggulu</a> buy generic shuddha guggulu over the counter
Wrigoi
xeloda 500 mg over the counter - <a href="https://xelocap.com/mefenamicacid/">order ponstel for sale</a> order danocrine 100 mg online cheap
Ggawnx
buy prometrium 200mg pill - <a href="https://apromid.com/">cost prometrium</a> cheap fertomid without prescription
Tzmoka
buy fosamax pills - <a href="https://pilaxmax.com/medroxyprogesterone/">provera 10mg for sale</a> order medroxyprogesterone 5mg
Cuzrag
buy norethindrone 5mg online - <a href="https://norethgep.com/yasmin/">yasmin online buy</a> yasmin drug
Mpahph
buy generic estrace over the counter - <a href="https://festrolp.com/ginette-35/">order generic ginette 35</a> order anastrozole 1 mg
Zhkiej
oral cabergoline - <a href="https://adostilin.com/cabgolin/">cabgolin without prescription</a> alesse over the counter
Osxpnp
プレドニン通販おすすめ - <a href="https://jpaonlinep.com/">プレドニン の購入</a> アジスロマイシンは薬局で買える?
Azmgym
シルデナフィル は通販での購 - <a href="https://jpedpharm.com/">バイアグラ処方</a> シアリス 薬局で買える
Kuazyd
プレドニン 薬局で買える - <a href="https://jpanfarap.com/">プレドニンジェネリック 通販</a> イソトレチノイン 市販 おすすめ
Ftfjgf
eriacta mortal - <a href="https://eriagra.com/asildigrah/">sildigra valley</a> forzest line