文档库 最新最全的文档下载
当前位置:文档库 › Diversityof microbial communities colonizing thewalls ofaKarstic

Diversityof microbial communities colonizing thewalls ofaKarstic

Diversityof microbial communities colonizing thewalls ofaKarstic
Diversityof microbial communities colonizing thewalls ofaKarstic

R E S E A R C H A R T I C L E

Diversity of microbial communities colonizing the walls of a Karstic cave in Slovenia

Lejla Pas

ˇi ′c ,Barbara Kovc ˇe,Boris Sket &Blagajana Herzog-Velikonja Department of Biology,Biotechnical Faculty,University of Ljubljana,Ljubljana,Slovenia

Correspondence:Lejla Pas

ˇi ′c,Department of Biology,Biotechnical Faculty,University of

Ljubljana,Vec

ˇna pot 111,1000Ljubljana,Slovenia.Tel.:138614233388;fax:138612573390;e-mail:lejla.pasic@bf.uni-lj.si Received 27February 2009;revised 17August 2009;accepted 6September 2009.

Final version published online 8October 2009.DOI:10.1111/j.1574-6941.2009.00789.x Editor:Kornelia Smalla

Keywords

hypogean environments;16S rRNA gene;

diversity;Bacteria ;microbial communities;cave.

Abstract

Karstic cave systems in Slovenia receive substantial amounts of organic input from adjacent forest and freshwater systems.These caves host microbial communities that consist of distinct small colonies differing in colour and shape.Visible to the naked eye,the colonies cover cave walls and are strewn with light-re?ecting water droplets.In this study,the diversity of prokaryotes constituting these unusual microbial communities in Pajsarjeva jama cave was examined.A molecular survey based on small subunit rRNA diversity showed a high diversity within the Bacteria ,while members of Archaea were not recovered.A total of eight bacterial phyla were detected.The application of various species richness estimators con?rmed the diverse nature of the microbial community sample.Members of Gammaproteo-bacteria were most abundant in the clone libraries constructed and were followed in abundance by members of Actinobacteria and Nitrospira .In addition,members of Alphaproteobacteria ,Betaproteobacteria and Deltaproteobacteria as well as Acidobacteria ,Verrucomicrobia ,Planctomycetes ,Chloro?exi and Gemmatimona-detes were identi?ed in clone libraries.The high number of clones most closely related to environmental 16S rRNA gene clones showed the broad spectrum of unknown and yet to be cultivated microorganisms inhabiting these cave systems.

Introduction

Caves are considered to be nutrient-limited ecosystems subjected to stable temperatures and high humidity.Life here is supported by photosynthetic activity only in entrance corridors where light penetrates the cave.Alternatives to carbon ?xation in caves include chemoautotrophy and ammonium-,nitrite-,sulphur-,manganese-or iron-oxidiz-ing chemolithoautotrophy (Northup &Lavoie,2001).

Extensive areas,40%of Slovenia,are shaped by the dissolution of limestone or dolomite to a Karstic landscape (Gams,2004).The cave biota mainly depends on the organic input from the surface.The most obvious and most direct case of the plant and animal contribution is through penetrating roots and bat guano.But mainly,the organic material enters the caves diffusely,dissolved or dispersed in the dripping waters through the ceiling or as clay deposited on the ground and walls by subterranean rivers,or as particles drifted by air currents.This amount of organic matter supports secondary development of microbial com-munities on cave walls.These develop as multicoloured

yellow,grey,white and pink cloddy coatings up to 1mm thick on carbonate or clay-coated walls and ceilings of the cave.When illuminated,water droplets,usually scattered on the coatings,re?ect the silvery or gold-coloured light,depending on the prevalence of whit(ish)or yellow colour,respectively,in underlying coatings.This earned the bacter-ial coatings the name ‘cave silver’or ‘cave gold’among the

local cavers (Megus

ˇar &Sket,1977;Sket,1979).The devel-opment of such microbial communities on cave walls is observed along a number of caves of the region,most often in corridors along the allogenous cave streams,but outside water.Early studies focused on one such community in-habiting cave Planinska jama located approximately 20km south of the cave studied here.In these studies,the organic nature of these coatings was shown,and it was found that their characteristic colouration is not due to Mn or Fe salts.The microbial community,as depicted using the cultivation approach,was found to be dominated by members of Actinomycetales .The isolates obtained could not ?t any of

FEMS Microbiol Ecol 71(2010)50–60

c

2009Federation of European Microbiological Societies Published by Blackwell Publishing Ltd.All rights

reserved

M I C R O B I O L O G Y E C O L O G Y

by guest on January 28, 2016

https://www.wendangku.net/doc/fb12568690.html,/Downloaded from

the species then described (P .Kovac

ˇ,D.Merlak,F.Megus ˇar,B.Sket,unpublished data).Accordingly,members of Actino-mycetales were most commonly isolated from cave wall colony samples of well-studied Altamira and Tito Bustillo caves (Spain).However,Actinomycetales constituted only a minor portion of a broad spectrum of unknown and yet to be cultivated bacterial species when the same samples were analysed using a cultivation-independent approach (Laiz et al .,2003).

We believe that characterization of such microbial com-munities could serve as a basis to infer the dynamics between species assemblages and energy inputs in these ecosystems.To this aim,the microbial communities found in the easily accessible Pajsarjeva jama,20km southwest of Ljubljana,Slovenia,were extensively sampled.This horizon-tal cave is 555m long and contains a small stream exiting the underground at its entrance.It is only occasionally visited by cavers and speleologists,but pipes of a water supply for the small ?sh-hatchery are inserted into it.We have no data on the terrestrial fauna of the cave,except for modest colonies of subtroglophile bats Rhinolophus hipposideros (Bechstein)and Rhinolophus ferrumequinum (Schreber).Besides some troglobionts,the fauna of the streamlet includes epigean amphipods Gammarus cf.fossarum Koch,numerous larvae of Chironomidae ,less numerous larvae of Plecoptera (cf.Nemoura sp.),Rotatoria and Acarina and only single specimens of Elmintidae (Coleoptera ),Trichoptera and Hydra sp.This compartment of its fauna shows that the streamlet originates on the surface.We have sampled microbial com-munities in a totally dark section of the entrance gallery (some tens of metres)before the siphon,preventing simple access to inner parts of the cave.The aim of this study was to provide baseline descriptive data on indigenous light-re?ect-ing microbial communities formed on cave walls.

Materials and methods

Sample collection

Cave wall microbial community samples were collected from Pajsarjeva jama (cadastral no.115),near Ljubljana,Slovenia (4515905100N,1411601500E),in March 2008.Micro-bial communities covering a cave wall area of approximately 2m 2situated on the right bank of the streamlet before siphon were sampled.Within this area,six samples,each covering an area of approximately 0.1m 2,were taken by scraping off colonies with a sterile scalpel without touching the supporting rocks.The samples were represented by a mixture of white,yellow,grey,greyish blue and pink macro-scopic colonies.Upon collection,the samples were stored on ice and processed or frozen within 2h after collection.The temperature and pH of the stream waters were measured in situ using probes (WTW,Weilheim,Germany).

Molecular techniques

Environmental DNA was extracted from each sample using the MoBio PowerSoil TM DNA kit (MoBio)according to the manufacturer’s instructions.Ampli?cations of bacterial 16S rRNA gene were performed using respective environmental DNA templates,Taq DNA polymerase (Fermentas),primers 27F (50-AGA GTT TGA TCC TGG CTC AG-30)and 1492R (50-GGT TAC CTT GTT ACG ACT T-30)and the following programme:941C (5min),followed by 25cycles of 941C (1min),451C (45s),721C (1min)and a ?nal 20-min extension step of 721C.Ampli?cations of archaeal 16S rRNA gene were performed using respective environmental DNA templates,Taq DNA polymerase (Fermentas),primers D30(50-ATT CCG GTT GAT CCT GC)and D56(50-GYT ACC TTG TTA CGA CTT)from Arahal et al .(1996)and the following programme:941C 2min,followed by 30cycles of 941C (45s),501C (45s)and 721C (90s)with an additional 5s added for each cycle with a ?nal 10-min extension step of 721C.The second set of 16S rRNA gene PCR ampli?cations was performed using primers Arch21F (50-TTC CGG TTG ATC CYG CCG GA)and Arch958R (50-YCC GGC GTT GAM TCC AAT T)following the protocol described by DeLong (1992).

PCR products were checked for size and concentration by gel electrophoresis and were then cloned using the pGEM s -T Easy cloning kit (Promega)and used to transform competent Escherichia coli JM109cells (Promega)as speci-?ed by the manufacturer.Six clone libraries were con-structed,one for each sample collected.Insert-positive plasmids were isolated from overnight liquid cultures,using the Wizard Plus SV Minipreps DNA puri?cation kit (Pro-mega).An aliquot of each culture was preserved in 15%w/v sterile glycerol and stored at à801C.A total of 28,35,36,38,40and 40clones were sequenced from their respective libraries at MacrogenUSA (Maryland)using T7and SP6plasmid-speci?c primers and a 536F internal rRNA primer (50-CAG CMG CCG CGG TAA TWC-30).

Sequence comparisons and phylogenetic analysis

Partial sequences of clone inserts sequenced were assembled using SEQUENCHER (Gene Codes,Ann Arbor).Assembled sequences were checked for chimera by BELLEROPHON server (Huber et al .,2004)and CHIMERA _CHECK v. 2.7(Cole et al .,2003).For BELLEROPHON analysis,a variety of window sizes (200–400bp)and corrections were used.Putative chimeric sequences were excluded from further analysis and the remaining 171sequences were included in phyloge-netic analysis.Relevant sequences were obtained from GenBank (https://www.wendangku.net/doc/fb12568690.html,,BLASTN algorithm),GREENGENES (https://www.wendangku.net/doc/fb12568690.html,/cgi-bin/nph-index.cgi,‘‘Classify’’tool)and the Ribosomal Database Project

FEMS Microbiol Ecol 71(2010)50–60

c

2009Federation of European Microbiological Societies Published by Blackwell Publishing Ltd.All rights reserved

51

Diversity of microorganisms colonizing cave walls by guest on January 28, 2016

https://www.wendangku.net/doc/fb12568690.html,/Downloaded from

(https://www.wendangku.net/doc/fb12568690.html,/,‘‘Seqmatch’’tool).Alignment of these and the clone sequences obtained was generated by MUSCLE(Edgar,2004)and the quality was checked by CORE

available from TCOFFEE web server(http://tcoffee.vital-it.ch/ cgi-bin/Tcoffee/tcoffee_cgi/index.cgi).Gaps and ambigu-ously aligned positions were excluded from our analyses.In order to choose representative subsets of16S rRNA gene sequences for further phylogenetic analyses,neighbour-joining trees were constructed using MEGA(Kumar et al., 2008).Four different subsets of16S rRNA gene sequences were selected to achieve good taxonomic coverage of differ-ent regions in phylogenetic trees.These subsets contained representatives of operational taxonomic units(OTUs) detected in this analysis and relevant related sequences and were Actinobacteria and Acidobacteria(40sequences,1188 positions),Betaproteobacteria(32sequences,1220posi-tions),Alphaproteobacteria,Gammaproteobacteria and Deltaproteobacteria(46sequences,1232positions)and Plancytomyces,Verrucomicrobia,Chloro?exi,Gemmatimona-detes and Nitrospirae(31sequences,1154positions).These datasets were analysed by maximum parsimony(MP)using PAUP

?(Swofford,2001)and maximum likelihood(ML) using PHYML(Guindon&Gascuel,2003).ML searches were performed by applying a general time-reversible model of sequence evolution and taking among-site variation into account using a four-category discrete approximation of a G distribution with a portion of invariable sites.ML and MP bootstrap support values were assessed by1000bootstrap replications.The heuristic branch-swapping algorithm TBR with10?addition sequences randomized was applied under this optimality criterion.Bayesian posterior probabil-ities were computed under the same ML model with MRBAYES 3.0b4(Huelsenbeck&Ronquist,2001)with a Metropolis-coupled Markov chain Monte Carlo algorithm(Larget& Simon,1999)by running four chains for106generations, taking samples every100generations.The initial6%of the trees was discarded as‘burn-in’to ensure that the chains had reached stationarity.From the resulting9400trees,posterior probabilities were assessed for individual clades based on their observed frequencies.

The sequences reported in this study were submitted to GenBank with accession numbers FJ535064–FJ535113. Biodiversity estimates

Rarefaction curves and different biodiversity indices were estimated from our sequence data using DOTUR(Schloss& Handelsman,2005).Clone sequences obtained in this study were aligned using MUSCLE(Edgar,2004)and the respective distance matrices were generated under the Kimura two-parametric evolutionary model in PHYLIP(Felsenstein,1993). The resulting matrices were used as input for DOTUR in order to(1)assign sequences to OTUs using the furthest neighbour algorithm at an evolutionary distance of3% and(2)generate rarefaction curves and species richness estimates.

Results and discussion

Sample characteristics and microscopy

The light-re?ecting cave wall microbial communities were observed throughout the visited gallery of Pajsarjeva jama cave at both its entrance and in the deeper parts,and covered extensive areas of the walls and ceiling(Fig.1a). The observed microbial growth(Fig.1b)was approximately 1mm thick.Under low magni?cations of the

dissecting

Fig.1.(a)Light-re?ecting cave microbial

community on the sampling site in Pajsarjeva

jama;(b)a close-up of microbial community

showing its texture;(c)scanning electronic

micrograph of the microbial community showing

densely packed branching?laments.

FEMS Microbiol Ecol71(2010)50–60

c 2009Federation of European Microbiological Societies

Published by Blackwell Publishing Ltd.All rights reserved

52L.Pasˇi′c et al.

by guest on January 28, 2016

https://www.wendangku.net/doc/fb12568690.html,/

Downloaded from

microscope (Olympus SZX 12),the sample was hetero-geneous in nature and was composed of cauli?ower-like,?at,adhered and thread-like forms.These were sulphur yellow,white,pink,grey or greyish blue in colour with droplets of water scattered on the surface,causing the characteristic light re?ection.In order to recover as much prokaryotic diversity as possible,an area covering approxi-mately 2m 2was extensively sampled using sterile scalpels.At the time of sampling,the air temperature,which is relatively constant all year round,was 121C and the relative humidity was 100%.The pH of the water droplets from the sampling site was 7.0.

Optical microscopy of the cave microbial mat showed a wide range of prokaryotic microbial morphologies.Branch-ing ?laments,resembling members of phylum Actinobacteria ,were most frequently observed in the sample.Other char-acteristic morphologies included coccoid and bacillary forms,presumed to represent prokaryotic cells.These ob-servations were con?rmed by scanning electron microscopy,which once again con?rmed the domination of branching ?laments (Fig.1c).In these terms,the morphology observed was similar to the morphology of yellow colonies found on the cave walls of the Altamira cave (Cuezva et al .,2009).The latter were also found to adsorb the water vapour and retain it for long periods of time,thus acting as water condensation points (Cuezva et al .,2009).

Overall phylogenetic diversity and species richness in cave wall microbial community samples

The total environmental DNA extracted from cave wall microbial community was used as a template in order to amplify SSU rDNAs.Although we have used two different combinations of Archaea -speci?c primers,we were unable to amplify any 16S rRNA gene sequences of archaeal origin.Therefore,only bacterial 16S rRNA gene sequences were ampli?ed.This contrasts with the ?ndings reported from the Spanish Altamira cave,where novel lineages of low-temperature Crenarchaeota were shown to constitute metabolically active components of yellow-,grey-and white-coloured cave wall colonies (Gonzales et al .,2006).In order to minimize potential PCR bias,six gene libraries were constructed.A total of 171high-quality partial ($800bp)sequences were compared with GenBank sequences using the BLASTN algorithm.A wide diversity was encountered with members of eight different phyla identi-?ed in the cave wall microbial community sample.Phylo-genetic relatives were (in order of abundance)as follows:(1)Proteobacteria ,(2)Actinobacteria ,(3)Nitrospira ,(4)Acido-bacteria ,(5,6)Chloro?exi and Gemmatimonadales ,(7)Verrucomicrobia and (8)Planctomycetales as summarized in Fig.2.

In order to estimate the level of phylotype redundancy (rarefaction curves)and to calculate various species richness indices at different levels of evolutionary distance,DOTUR was used.We have considered three levels of OTUs de?ned at evolutionary distances of 3%,5%and 20%as rough approximations to the species,genus and phylum levels.Rarefaction curves are presented in Fig.3.Although there was a trend towards stationarity at 20%evolutionary distance,none of the rarefaction curves reached a clear plateau,showing that cave samples are very diverse at the genus level and beyond.At 3%evolutionary distance,a total of 50OTUs were detected in six libraries constructed.Although the richness estimators were reported to stabilize at a smaller sampling effort than rarefaction curves (Kemp &Aller,2004),a similar trend was observed in Chao1richness estimate collector’s curves (Fig.3).The level of diversity encountered re?ected in the biodiversity estimates calcu-lated.Chao1estimate is based on the presence of singletons and doubletons,which frequently account for most of the phylotypes observed in 16S rRNA gene libraries (Bohannan &Hughes,2003).The values obtained for Chao1and ACE estimators overlapped,considering their respective con?-dence intervals,which were quite large at the 3%and 5%evolutionary distance.Consistent with other estimates,the Shannon index,used to compare OTU richness in different samples,was high (over 3)at 3%evolutionary distance (Table 1).

Bacterial community composition

Actinobacteria and Acidobacteria

The various phylotypes retrieved were ascribed to Actino-bacteria and Acidobacteria (Fig.4).Phylotypes related

to

Fig.2.Distribution of major phylogenetic groups in 16S rRNA gene clone libraries constructed from environmental DNA obtained from the Pajsarjeva jama cave wall microbial community (Slovenia).

FEMS Microbiol Ecol 71(2010)50–60

c

2009Federation of European Microbiological Societies Published by Blackwell Publishing Ltd.All rights reserved

53

Diversity of microorganisms colonizing cave walls by guest on January 28, 2016

https://www.wendangku.net/doc/fb12568690.html,/Downloaded from

Actinobacteria represented 16.3%of the sequences obtained and were the second most retrieved group from the cave wall microbial community sample.The sequence similarities of our clone library sequences to sequences listed in GenBank were between 88%and 93%,indicative of novel,previously

nondescribed Actinobacteria phylotypes.The majority of

Actinobacteria -related sequences from Pajsarjeva jama clone libraries were af?liated with sequences recovered from Alpine dolomite rocks (clone 2PJM54,88%sequence simi-larity,9%of sequences recovered)and were followed in

Table 1.Diversity indices for cave bio?lm samples estimated at different levels of difference in evolutionary distances as implemented in DOTUR (Schloss &Handelsman,2005)

Diversity indices Cave bio?lm

3%evolutionary distance difference ?CI (5%)5%evolutionary

distance difference ?CI (5%)20%evolutionary

distance difference ?CI (5%)Simpson 0.07

0.08

0.14

Shannon 3.19?0.19 3.05?0.19 2.32?0.16ACE 69.4?13.267.0?14.920.2?1.8Chao1

62.8?20.5

57.3?21.1

20.4?2.7

When applicable,5%con?dence intervals (CI)are

given.

Fig.3.Rarefaction curves (a)and Chao1

richness estimator collector’s curves (b)for Pajsarjeva jama cave wall microbial community samples.Rarefaction curves and Chao1richness estimator collector’s curves have been calculated at evolutionary distances of 0%,3%,5%and

20%.

Fig.4.ML phylogenetic tree showing the

positions of phylotypes recovered from Pajsarjeva jama cave wall microbial community clone libraries belonging to Acidobacteria and

Actinobacteria .Names in italics correspond to cultivated species,while the rest correspond to 16S rRNA gene https://www.wendangku.net/doc/fb12568690.html,s in bold correspond to the clones obtained in this study.Only bootstrap values 475%are given at nodes.From top to bottom:ML,MP and posterior probability (expressed as percentage).

FEMS Microbiol Ecol 71(2010)50–60

c

2009Federation of European Microbiological Societies Published by Blackwell Publishing Ltd.All rights reserved

54L.Pas

ˇi ′c et al . by guest on January 28, 2016

https://www.wendangku.net/doc/fb12568690.html,/Downloaded from

abundance by sequences af?liated to environmental sequences obtained from alkaline saline soils of the former lake Texcoco (clones 3PJM21,3PJM80,3PJM67)and se-quences related to members of Amycolatopsis (clone 3PJM120)and Frankia (clone 2PJM50).It is worth men-tioning that Actinobacteria from caves form a diverse group with isolates and environmental sequences af?liated to Arthrobacter,Acidimicrobidae ,Actinosynnemataceae ,Brevi-bacterium ,Frankia ,Kocuria ,Microbacteriaceae ,Micrococca-ceae ,Nocardiaceae ,Nocardioidaceae ,Pseudonocardiaceae ,Streptomycetaceae ,Saccharothrix and Rhodococcus (Cun-ningham et al .,1995;Groth &Saiz-Jimenez,1999;Groth et al .,1999,2001;Laiz et al .,1999,2000;Holmes et al .,2001;Schabereiter-Gurtner et al .,2002a;Northup et al .,2003).The results obtained in this study are in accordance with the results of a previous cultivation study on microbial communities in cave Planinska jama,located approximately 20km south of Pajsarjeva jama cave.Members of Actinomy-cetales were most frequently recovered within this cultiva-tion effort and were identi?ed as members of Brevibacterium and Proactinomyces genera.However,their characteristics could not ?t any of the described species.Further studies of Proactinomyces isolates showed that these bluish-grey colo-nies were able to disintegrate CaCO 3,which is in accordance with the fact that the calcareous rock is regularly mushy under the coatings.Furthermore,a Bacillus and a Pseudo-monas species were reported from the same sampling site (Mulec et al .,2002).

A common constituent of microbial communities colo-nizing cave walls are different types of crystals,produced by members of Actinobacteria .Because of this phenotype,it has been proposed that these bacteria and others are directly or indirectly involved in constructive biomineralization pro-cesses in caves (Laiz et al .,1999;Barton et al .,2001;Ca ?n

averas et al .,2001;Groth et al .,2001;Jones,2001).This phenomenon was not observed in the microbial colonizations studied,and it remained unclear whether the characteristic light-re?ecting water droplets observed at the surface of microbial cave wall communities of both caves studied are a condensate or an exudate of microbial community.

The phylum Acidobacteria is a recently described mono-phyletic phylum with only a handful of cultivated species.Members of this phylum represent another group found in abundance in several Karstic cave microbial mat and sedi-ment bacterial communities;yet,their function remains unknown at present.Based on culture-independent studies,Acidobacteria formed an ecologically signi?cant constituent of microbial communities inhabiting Palaeolithic paintings in Spanish Tito Bustillo cave (Schabereiter-Gurtner et al .,2002b)and La Garma cave (Schabereiter-Gurtner et al .,2004)as well as in biodeteriorating ?lms in Roman cata-combs (Italy)(Zimmermann et al .,2005)and Wind Cave

sediment (USA)(Chelius &Moore,2004).However,in Pajsarjeva jama microbial community clone libraries,this phylum was only moderately abundant and represented 10.5%of the clone sequences obtained.The clone sequences retrieved from cave wall microbial community DNA formed a phylogenetically diverse group,represented by nine phylo-types.Seven novel phylotypes sharing sequence similarities with known sequences in GenBank of o 95%were de-scribed.This suggests that the gene libraries constructed in this study represent the Acidobacteria community,which is different in structure from the communities studied so far.The Acidobacteria were previously divided into eight deeply branching subgroups (Hugenholtz et al .,1998)and recently expanded to 11subgroups (Zimmermann et al .,2005).In Lower Kane Cave,a sulphidic cave system,acidobacterial populations appear to be dominated by members of subgroups 7and 8(Meisinger et al .,2007).Analysis of 16S rRNA gene placed Pajsarjeva jama clone sequences within acidobacterial subgroups 4and 3.Related phylotypes were previously reported from Karstic Altamira cave,where these subgroups represented 29%and 12%of the total OTU number,respectively (Zimmermann et al .,2005).In the same study,acidobacterial OTUs belonging to subgroup 4were af?liated with grey cave wall colonies forming within Altamira cave.

Proteobacteria

The ecologically successful Proteobacteria were the most abundant phylum in clone libraries and represented 51.4%of the sequences obtained.Important differences were observed in the relative distribution and abundance of the different proteobacterial subdivisions.Gammaproteobacter-ial phylotypes were by far the most abundant in the clone libraries constructed and represented 31.5%of all sequences recovered (Fig.5).A vast majority of these sequences (23.4%)branched within purple sulphur bacteria and there-fore might be involved in oxidation of hydrogen sulphide in anoxic parts of the microbial colonization.These sequences are represented by phylotypes 3PJM14,3PJM42and 3PJM72,and were closely related (96–99%sequence simi-larity)to environmental sequences recovered from Oregon Caves National Monument (clone ORCA-17N118,DQ823220).Another group of phylotypes within Gamma-proteobacteria was found to be related to Xanthomonadales .Bacteria from this order frequently impair yellow coloura-tion due to their production of carotenoids.Besides,Xanthomonadales were found to be exclusively associated with yellow colonizations developing on the walls of Alta-mira cave (Portillo et al .,2008),and thus might contribute to yellow colonizations developing on sampling sites in this study.The phylotypes recovered in this study formed a

FEMS Microbiol Ecol 71(2010)50–60

c

2009Federation of European Microbiological Societies Published by Blackwell Publishing Ltd.All rights reserved

55

Diversity of microorganisms colonizing cave walls by guest on January 28, 2016

https://www.wendangku.net/doc/fb12568690.html,/Downloaded from

diverse group related to environmental sequences recovered from soil,freshwater of cultivated denitrifying species.

The abundance of typical terrestrial taxa,such as Alpha-proteobacteria ,was low in the libraries constructed.Only a handful of phylotypes could be af?liated with this subdivi-sion.The environmental sequences represented by phylo-types 3PJM100and 3PJM8were closely related to environmental sequences recovered from soil surrounding iron–manganese nodules (clone JH-WH224,EF492889;99%sequence similarity).Another group of clones,repre-sented by phylotype 3PJM78,was found to be distantly related to sequences recovered from tall grass prairie soil (clone FFCH15553,EU133452,95%sequence similarity).A similar pattern of abundance was observed in Deltaproteo-bacteria ,a subdivision that encompasses anaerobic sul-phate-reducing bacteria.Only three phylotypes (2PJM57,3PJM140and 1PJM294)were af?liated to this group and were all related to other environmental soil Deltaproteo-bacteria sequences with sequence similarities between 92%and 97%.Thus,their putative functional description re-mains elusive.The Epsilonproteobacteria were absent from the clone libraries.

In contrast with latter observations,phylotypes related to Betaproteobacteria (Fig.6)formed a well-represented and diverse group.The dominant phylotypes belonging to this Proteobacteria subdivision were related to cave sequences

either recovered from acidic,pendulous cave wall microbial

mats from the Frasassi cave system (Macalady et al .,2007)or rock microbial mats from a gold mine in Poland (clone A05-1,FM253568).Except for phylotypes distantly related to methyl-tert -butyl ether-degrading strain PM1(clone 3PJM33)and ammonia-oxidizing Nitrosomonas europea (clone 3PJM125),we were unable to af?liate the remaining phylotypes to any cultivated species.However,these were found to be most closely related,with similarities between 94%and 99%,to sequences from soil habitats.

The fact that the identi?ed bacterial community was dominated by the Proteobacteria is in accordance with previous cave studies.This cosmopolitan group was found to dominate in almost all cave biota studied.In Spanish Altamira cave,one of the best microbiologically studied subsurface systems,Proteobacteria were found to dominate in dripping waters,Palaeolithic painting bacterial commu-nities (Laiz et al .,1999;Schabereiter-Gurtner et al .,2002a)and yellow,grey and white cave wall colonizations (Portillo et al .,2008,2009).Similarly,Proteobacteria constituted up to 50%of the bacterial cave wall communities encountered in Tito Bustillo cave,Spain (Schabereiter-Gurtner et al .,2002b),and were among the dominant groups in bacterial communities encountered in sediment collected from Wind Cave,USA (Chelius &Moore,2004).The dominance of Proteobacteria has also been reported from the

extreme

Fig.5.ML phylogenetic tree showing the

positions of phylotypes recovered from Pajsarjeva jama cave wall microbial community clone libraries belonging to Alphaproteobacteria ,

Gammaproteobacteria and Deltaproteobacteria .Names in italics correspond to cultivated species,while the rest correspond to 16S rRNA gene https://www.wendangku.net/doc/fb12568690.html,s in bold correspond to the clones obtained in this study.Only bootstrap values 475%are given at the nodes.From top to bottom:ML,MP and posterior probability (expressed as percentage).

FEMS Microbiol Ecol 71(2010)50–60

c

2009Federation of European Microbiological Societies Published by Blackwell Publishing Ltd.All rights reserved

56L.Pas

ˇi ′c et al . by guest on January 28, 2016

https://www.wendangku.net/doc/fb12568690.html,/Downloaded from

environment of sulphur caves.Epsilon -and Gammaproteo-bacteria were found to be important bio?lm-forming groups in sulphidic springs and streams of Parker cave (Kentucky),Cesspool cave (Virginia),Lower Kane Cave (Wyoming)and Movile cave (Romania)(Angert et al .,1998;Sarbu,2000;Engel et al .,2001,2003).In the Frassasi cave system (Italy),sulphur-cycling Proteobacteria clades accounted for 475%of clones in limestone corroding stream microbial mats libraries (Macalady et al .,2006)and represented the domi-nant portion of diversity in extremely acidic,pendulous cave wall microbial mats analysed from the same cave system (Macalady et al .,2007).Although they are not commonly found in environments that are characterized by severe pH,temperature,nutrient or water tension stresses,Proteo-bacteria are well known for their ability to degrade a wide diversity of organic substrates (Palleroni,1992).As observed in previous studies,enhanced nutrient availability is one possible explanation for the observed dominance of Proteo-bacteria .Northup et al.(2003)compared microbial com-munities inhabiting ferromanganese deposits in extremely oligotrophic and isolated Lechuguilla cave with microbial communities inhabiting the shallow,weekly visited Spider cave.Increased numbers of nitrogen-?xing Proteobacteria were reported from the human-impacted Spider cave.Similarly,the cultivable microbial diversity study of Kart-chner Caverns (USA)showed the dominance of Proteobac-teria in high human-impacted areas,while Firmicutes ,known to resist desiccation and nutrient stress,dominated in low human-impacted areas (Ikner et al .,2006).Finally,in

the highly human-impacted Lascaux cave microbial coloni-zations were af?liated almost exclusively to Proteobacteria (Bastian et al .,2009).

Verrucomicrobia ,Planctomycetales ,

Gemmatimonadales ,Nitrospirales and Chloro?exi Among the processed sequences,additional components of the bacterial cave wall microbial community belonged to the phyla Verrucomicrobia ,Planctomycetes ,Gemmatimonadetes and Chloro?exi (Fig.7).Clone sequences represented by 3PJM118were found to be distantly related to Verruco-microbium spinosum ,a species inhabiting eutrophic fresh-waters.Sequences represented by clone 3PJM51were related to Gemmatimonas aurantiaca .Although this species remains the only cultivated member of Gemmatimonadetes ,environ-mental sequence data indicate that this phylum is wide-spread in nature and has a phylogenetic breadth (19%16S rRNA gene sequence divergence)that is greater than well-known phyla such as the Actinobacteria (18%divergence)(Zhang et al .,2003).Indeed,members of Gemmatimona-detes were recently reported from an earth cave in Guizhou province,China,where they represented 2.7%of the soil microbial community (Zhou et al .,2007).Planctomycetales were represented by a single sequence 1PJM18,related to environmental sequences recovered from a hypersaline microbial mat and Chloro?exi by sequences 3PJM52and 1PJM279,which branched with environmental soil se-quences within genera Chloro?exus and Caldilinea

.

Fig.6.ML phylogenetic tree showing the

positions of phylotypes recovered from Pajsarjeva jama cave wall microbial community clone

libraries belonging to Betaproteobacteria .Names in italics correspond to cultivated species,while the rest correspond to 16S rRNA gene https://www.wendangku.net/doc/fb12568690.html,s in bold correspond to the clones obtained in this study.Only bootstrap values 475%are given at nodes.From top to bottom:ML,MP and posterior probability (expressed as percentage).

FEMS Microbiol Ecol 71(2010)50–60

c

2009Federation of European Microbiological Societies Published by Blackwell Publishing Ltd.All rights reserved

57

Diversity of microorganisms colonizing cave walls by guest on January 28, 2016

https://www.wendangku.net/doc/fb12568690.html,/Downloaded from

Finally,a large group of clones was af?liated with phylum Nitrospira .These represented 15.2%of the clone libraries constructed (Fig.7).The sequences phylogenetically related to sequences obtained in this study were previously de-scribed in a well-studied sulphur cave –Frassasi cave system,where they represented only a minor portion of the diversity encountered (Macalady et al .,2007;Fig.7,pre?x CV).The remaining Nitrospira clone sequences were found to be related to ammonia oxidizers such as Nitrospira spp.Although few Nitrospira cultures have been characterized,all known strains are obligate chemolithoautotrophs that obtain their energy for growth from the oxidation of nitrite.This process has been reported previously to contribute to cave food webs in Mexican anchialine caves (Pohlman et al .,1997),which received organic material in a manner similar to the caves studied here –from adjacent forest and aquatic systems.Furthermore,members of Nitrospira were found to contribute signi?cantly to bacterial communities inhabiting rock surfaces of the Tito Bustillo cave (Schabereiter-Gurtner et al .,2002a).

Conclusion

Clone library sequences recovered in this study revealed diverse microbial communities.A number of phylotypes encountered were previously recovered from cave samples worldwide.Based on the physiological and biochemical characteristics of cultured isolates related to clone library sequences,the cave wall microorganisms are involved in nitrogen cycling and fermentation of organic carbon.How-ever,it is important to be cautious in interpreting this information as closely related organisms can have very different physiologies.

Based on phylogenetic analysis,the light-re?ecting cave wall microbial community was dominated by members of Gammaproteobacteria ,Actinobacteria and Nitrospira .Thus,in its composition,the microbial community studied shared a number of similarities to microbial formations developing on the walls of human-impacted caves.However,this study also revealed the presence of several novel and possibly abundant phylotypes of Actinobacteria ,Acidobacteria and Nitrospira ,expanding our knowledge of the diversity of these groups and the habitats in which they occur.

Acknowledgements

We thank Maja Zagmajster for ?eld assistance and Kazimir

Dras

ˇlar and Rok Kostanjs ˇek for microscopy assistance.This work was supported by Slovenian Research Agency research

programs P1-0198and P1-184.Barbara Kovc

ˇe contributed to this work as an undergraduate student.

References

Angert ER,Northup DE,Reysenbach AL,Peek AS,Goebel BM &

Pace NR (1998)Molecular phylogenetic analysis of a bacterial community in Sulphur River,Parker Cave,Kentucky.Am Mineral 83:11–12.

Arahal DR,Dewhirst FE,Paster BJ,Volcani BE &Ventosa A (1996)Phylogenetic analysis of some extremely halophilic archaea isolated from the Dead Sea water,determined on the basis of their 16S rRNA sequences.Appl Environ Microb 62:3779–3786.

Barton HA,Spear JR &Pace NR (2001)Microbial life in the underworld:biogenicity of secondary mineral formation.Geomicrobiol J 18:

359–368.

Fig.7.ML phylogenetic tree showing the

positions of phylotypes recovered from Pajsarjeva jama cave wall microbial community clone libraries belonging to Verrucomicrobia ,Planctomycetales ,Gemmatimonadales ,

Nitrospirales ,Chloro?exales and Caldilineales .Names in italics correspond to cultivated species,while the rest correspond to 16S rRNA gene https://www.wendangku.net/doc/fb12568690.html,s in bold correspond to the clones obtained in this study.Only bootstrap values 475%are given at nodes.From top to bottom:ML,MP and posterior probability (expressed as percentage).

FEMS Microbiol Ecol 71(2010)50–60

c

2009Federation of European Microbiological Societies Published by Blackwell Publishing Ltd.All rights reserved

58L.Pas

ˇi ′c et al . by guest on January 28, 2016

https://www.wendangku.net/doc/fb12568690.html,/Downloaded from

Bastian F,Alabouvette C &Saiz-Jimenez C (2009)Bacteria and free-living amoeba in the Lascaux Cave.Res Microbiol 160:38–40.

Bohannan BJ &Hughes J (2003)New approaches to analyzing microbial biodiversity data.Curr Opin Microbiol 6:282–287.Ca ?n

averas JC,Sanchez-Moral S,Soler V &Saiz-Jimenez C (2001)Microorganisms and microbially induced fabrics in cave walls.Geomicrobiol J 18:223–240.

Chelius MK &Moore JC (2004)Molecular phylogenetic analysis of Archaea and Bacteria in Wind Cave,South Dakota.Geomicrobiol J 21:123–134.

Cole JR,Chai B,Marsh TL et al .(2003)The Ribosomal Database Project (RDP-II):previewing a new autoaligner that allows regular updates and the new prokaryotic taxonomy.Nucleic Acids Res 31:442–443.

Cuezva S,Sanchez-Moral S,Saiz-Jimenez C &Ca ?n

averas JC (2009)Microbial communities and associated mineral fabrics in Altamira cave,Spain.Int J Speleol 38:83–92.

Cunningham KI,Northup DE,Pollastro RM,Wright WG &LaRock EJ (1995)Bacteria,fungi and biokarst in Lechuguilla Cave,Carlsbad Caverns National Park,New Mexico.Environ Geol 25:2–8.

DeLong EF (1992)Archaea in coastal marine environments.P Natl Acad Sci USA 89:5685–5689.

Edgar RC (2004)MUSCLE:multiple sequence alignment with high accuracy and high throughput.Nucleic Acids Res 32:1792–1797.

Engel AS,Porter ML,Kinkle BK &Kane TC (2001)Ecological assessment and geological signi?cance of microbial

communities from Cesspool Cave,Virginia.Geomicrobiol J 18:259–274.

Engel AS,Lee N,Porter ML,Stern LA,Bennett PC &Wagner M (2003)Filamentous ‘Epsilonproteobacteria ’dominate

microbial mats from sul?dic cave springs.Appl Environ Microb 69:5503–5511.

Felsenstein J (1993)Phylogeny Inference Package (PHYLIP)Version 3.5.University of Washington,Seattle.

Gams I (2004)Kras v Sloveniji –v prostoru in c

ˇasu .Zalo &ba ZRC,Ljubljana,293pp.

Gonzales JM,Portillo MC &Saiz-Jimenez C (2006)Metabolically active Crenarchaeaota in Altamira cave.Naturwissenschaften 93:42–45.

Groth I &Saiz-Jimenez C (1999)Actinomycetes in hypogean environments.Geomicrobiol J 16:1–8.

Groth I,Vettermann R,Schuetze B,Schumann P &Saiz-Jimenez C (1999)Actinomycetes in Karstic caves of northern Spain (Altamira and Tito Bustillo).J Microbiol Meth 36:115–122.

Groth I,Schumann P ,Laiz L,Sanchez-Moral S,Ca ?n

averas JC &Saiz-Jimenez C (2001)Geomicrobiological study of the Grotta dei Cervi,Porto Badisco,Italy.Geomicrobiol J 18:241–258.Guindon S &Gascuel O (2003)A simple,fast,and accurate algorithm to estimate phylogenies by maximum likelihood.Syst Biol 52:696–704.

Holmes AJ,Tujula NA,Holley M,Contos A,James JM,Rogers P &Gillings MR (2001)Phylogenetic structure of unusual aquatic microbial formations in Nullarbor caves,Australia.Environ Microbiol 3:256–264.

Huber T,Faulkner G &Hugenholtz P (2004)Bellerophon:a program to detect chimeric sequences in multiple sequence alignments.Bioinformatics 20:2317–2319.

Huelsenbeck JP &Ronquist F (2001)MrBayes:Bayesian inference of phylogeny.Bioinformatics 17:754–755.

Hugenholtz P ,Goebel BM &Pace NR (1998)Impact of culture-independent studies on the emerging phylogenetic view of bacterial diversity.J Bacteriol 180:4765–4774.

Ikner LA,Toomey RS,Nolan G,Neilson JW,Pryor BM &Maier RM (2006)Culturable microbial diversity and the impact of tourism in Kartchner Caverns,Arizona.Microb Ecol 53:30–42.Jones B (2001)Microbial activity in caves –a geological perspective.Geomicrobiol J 18:345–357.

Kemp PF &Aller JY (2004)Bacterial diversity in aquatic and other environments:what 16S rDNA libraries can tell us.FEMS Microbiol Ecol 47:161–177.

Kumar S,Dudley J,Nei M &Tamura K (2008)MEGA:a

biologist-centric software for evolutionary analysis of DNA and protein sequences.Brief Bioinform 9:299–https://www.wendangku.net/doc/fb12568690.html,iz L,Groth I,Gonzalez I &Saiz-Jimenez C (1999)

Microbiological study of the dripping waters in Altamira cave (Santillana del Mar,Spain).J Microbiol Meth 36:129–https://www.wendangku.net/doc/fb12568690.html,iz L,Groth I,Schumann P,Zezza F,Felske A,Hermosin B &Saiz-Jimenez C (2000)Microbiology of the stalactites from Grotta dei Cervi,Porto Badisco,Italy.Int Microbiol 3:25–https://www.wendangku.net/doc/fb12568690.html,iz L,Gonzales JM &Saiz-Jimenez C (2003)Microbial communities in caves:ecology,physiology and effects on paleolythic paintings.Art,Biology and Conservation:

Biodeterioration of Works of Art (Koestler RJ,Koestler VR,Carola AE &Nieto-Fernandez FE,eds),pp.210–225.The Metropolitan Museum of Art,New York,NY.

Larget B &Simon D (1999)Markov chain Monte Carlo

algorithms for the Bayesian analysis of phylogenetic trees.Mol Biol Evol 16:750–759.

Macalady JL,Lyon EH,Koffman B,Albertson LK,Meyer K,Galdenzi S &Mariani S (2006)Dominant microbial

populations in limestone-corroding stream bio?lms,Frasassi cave system,Italy.Appl Environ Microb 72:5596–5609.Macalady JL,Jones DS &Lyon EH (2007)Extremely acidic,pendulous cave wall bio?lms from the Frasassi cave system,Italy.Environ Microbiol 9:1402–1414.

Megus

ˇar F &Sket B (1977)On the nature of some organic covers on the cave walls.Proceedings 6th International Congress Speleology,Olomouc,1973,Vol.5,pp.159–161.

Meisinger DB,Zimmermann J,Ludwig W,Schleifer KH,Wanner G,Schmid M,Bennet PC,Engel AS &Lee NM (2007)In situ detection of novel Acidobacteria in microbial mats from a chemolithoautotrophically based cave ecosystem (Lower Kane Cave,WY,USA).Environ Microbiol 9:1523–1534.

Mulec J,Zalar P,Zupan Hajna N &Rupnik M (2002)Screening for culturable microorganisms from cave environments (Slovenia).Acta Carsol 31:177–187.

FEMS Microbiol Ecol 71(2010)50–60

c

2009Federation of European Microbiological Societies Published by Blackwell Publishing Ltd.All rights reserved

59

Diversity of microorganisms colonizing cave walls by guest on January 28, 2016

https://www.wendangku.net/doc/fb12568690.html,/Downloaded from

Northup DE &Lavoie KH (2001)Geomicrobiology of caves:a

review.Geomicrobiol J 18:199–220.

Northup DE,Barns SM,Yu LE et al .(2003)Diverse microbial communities inhabiting ferromanganese deposits in

Lechuguilla and Spider Caves.Environ Microbiol 5:1071–1086.Palleroni NJ (1992)Introduction to the family

Pseudomonadaceae .The Prokaryotes ,Vol.3,2nd edn (Balows A,Trueper HG,Dworkin M,Harder W &Schliefer KH,eds),pp.3071–3103.Springer Verlag,New York,NY.

Pohlman JW,Iliffe TM &Cifuentes LA (1997)A stable isotope study of organic cycling and the ecology of an anchialine cave ecosystem.Mar Ecol Prog Ser 155:17–27.

Portillo MC,Gonzalez JM &Saiz-Jimenez C (2008)Metabolically active microbial communities of yellow and gray colonizations on the walls of Altamira cave,Spain.J Appl Microbiol 104:681–691.

Portillo MC,Saiz-Jimenez C &Gonzalez JM (2009)Molecular characterization of total and metabolically active bacterial communities of ‘white colonization’in the Altamira Cave,Spain.Res Microbiol 160:41–47.

Sarbu SM (2000)Movile Cave:a chemoautotrophically based groundwater ecosystem.Subterranean Ecosystems (Wilkens H,Culver DC &Humphreys WF,eds),pp.319–343.Elsevier,Amsterdam.

Schabereiter-Gurtner C,Saiz-Jimenez C,Pi ?n

ar G,Lubitz W &R¨o lleke S (2002a)Altamira cave Paleolithic paintings harbour partly unknown bacterial communities.FEMS Microbiol Lett 211:7–11.

Schabereiter-Gurtner C,Saiz-Jimenez C,Pi?n ar G,Lubitz W &R¨o lleke S (2002b)Phylogenetic 16S rRNA analysis reveals the presence of complex and partly unknown bacterial

communities in Tito Bustillo cave,Spain,and on its Palaeolithic paintings.Environ Microbiol 4:392–400.

Schabereiter-Gurtner C,Saiz-Jimenez C,Pi ?n

ar G,Lubitz W &R¨o lleke S (2004)Phylogenetic diversity of bacteria associated with palaeolithic paintings and surrounding rock walls in two Spanish caves (Llonin and La Garma).FEMS Microbiol Ecol 47:235–247.

Schloss PD &Handelsman J (2005)Introducing species richness DOTUR,a computer program for de?ning operational taxonomic units and estimating.Appl Environ Microb 71:1501–1506.

Sket B (1979)Z

ˇivljenje v kras ˇkem podzemlju .Mladinska knjiga (Pelikan),Ljubljana,33pp.

Swofford DL (2001)PAUP ?,Version 4.0b10[Computer Software and Manual].Sinauer Associates,Sunderland,MA.Zhang H,Sekiguchi Y,Hanada S,Hugenholtz P,Kim H,

Kamagata Y &Nakamura K (2003)Gemmatimonas aurantiaca gen.nov.,sp.nov.,a Gram-negative,aerobic,polyphosphate-accumulating micro-organism,the ?rst cultured

representative of the new bacterial phylum Gemmatimonadetes phyl.nov.Int J Syst Evol Micr 53:1155–1163.

Zhou J,Gu Y,Zou C &Mo M (2007)Phylogenetic diversity of bacteria in an earth-cave in Guizhou province,southwest of China.J Microbiol 45:105–112.

Zimmermann J,Gonzalez JM &Saiz-Jimenez C (2005)Epilithic bio?lms in Saint Callixtus Catacombs (Rome)harbour a

broad spectrum of Acidobacteria .Antonie van Leeuwenhoek 89:203–208.

FEMS Microbiol Ecol 71(2010)50–60

c

2009Federation of European Microbiological Societies Published by Blackwell Publishing Ltd.All rights reserved

60L.Pas

ˇi ′c et al . by guest on January 28, 2016

https://www.wendangku.net/doc/fb12568690.html,/Downloaded from

停车场管理系统—C语言课程设计.doc

停车场管理系统 1题目要求 设有一个可以停放n 辆汽车的狭长停车场,它只有一个大门可以供车辆进出。车辆按到达停车场时间的早晚依次从停车场最里面向大门口处停放(最先到达的第一辆车放在停车场的最里面)。如果停车场已放满n 辆车,则后来的车辆只能在停车场大门外的便道上等待,一旦停车场内有车开走,则排在便道上的第一辆车就进入停车站。停车站内如有某辆车要开走,在它之后进入停车场的车都必须先退出停车站为它让路,待其开出停车场后,这些车辆再依原来的次序进场。每辆车在离开停车场时,都应根据它在停车场内停留的时间长短交费。如果停留在便道上的车未进停车场就要离去,允许其离去,不收停车费,并且仍然保持在便道上等待的车辆的次序。编制一程序模拟该停车场的管理。 【基本要求】要求程序输出每辆车到达后的停车位置(停车场或便道上),以及某辆车离开停车场是的停车时间及它应该交的费用。 2需求分析 根据题目要求,因为停车场是一个单条的序列,可以用结构体实现;在程序中,需要知道每辆来车的具体停放位置,应提供提示、查找、标记工作。车辆离开要计时计费。另外,每天开始时,停车场要初始化。 3总体设计 这个系统可以分为:初始化、有车进入、有车离开、退出四个模块。 4详细设计 main()函数体内包含了界面选则部分menu(),并单独 抽出来作为一个独立函数,目的在于系统执行每部分 模块后能够方便返回到系统界面。即main()函数写为 如下: void main()/*主函数*/ { menu();/*菜单函数*/ } 菜单函数: void menu() { int n,w; do { puts("\t\t**************MENU**************\n\n"); puts("\t\t\t 1.初始化"); puts("\t\t\t 2.有车进入"); puts("\t\t\t 3.有车离开"); puts("\t\t\t 4.退出"); puts("\n\n\t\t*********************************\n"); printf("Please choice your number(1-4): [ ]\b\b"); scanf("%d",&n); if(n<1||n>4) /*对选择的数字作判断*/ { w=1; getchar(); } else w=0; }while(w==1); switch(n) { case 1:chushi();break; /*初始化函数*/ case 2:jinru();break; /*车辆进入函数*/

广工Anyview试题答案第八章

/********** 【习题】请编写函数func(char s[], char t[], int n), 由数组s中长度为n的字符序列构造其逆序列,并存储在数组t中。例如,由给定字符序列?慜敲求得逆序列?敜慲;由?瑜浩履 求得?敜業屴。 **********/ void func(char s[], char t[], int n) /* 数组s的前n个元素存放给定的字符序列, 数组t的前n个元素存放s的逆序列。 注意:数组的下标从0开始。 */ { for(int i=0;i

c语言期末测试题附答案

c语言期末测试题附答 案 集团标准化工作小组 #Q8QGGQT-GX8G08Q8-GNQGJ8-MHHGN#

课程代码:A100002 座位号: 《计算机技术基础(C 语言)》试卷A 姓名: 学号: 专业: 学院: 班级: 20 年 月 日 第一 部分 选择题(共 30 分) 一、单项选择题(本大题共 15 小题,每题只有一个正确答 案,答对一题得 2 分,共 30 分) 1、以下关于C 语言标识符的描述中,正确的是 【 】。 A )标 识符可以由汉字组成 B )标识符只能以字母开头 C )关键字可以作为用户标识符 D )Area 与area 是不同的标识符 2、使下列程序段输出“123,456,78”,键盘输入数据,正确的输入是【 】。 int i,j,k; scanf(“%d,%3d%d”,&i,&j,&k); printf(“%d,%d,%d \n”,i,j,k); 3、判断char 类型的变量c1是否为数字字符的正确表达式为 【 】。 A) (c1>=0)&&(c1<=9) B) (c1>=’0’)&&(c1<=’9’) C) ’0’<=c1<=’9’ D) (c1>=’0’)||(c1<=’9’) 4、若有语句int a=1,b=2,c=3;则以下值为0的表达式是 【 】。 A )’a’&&’b’ B )a<=b C )((a>b)||(b0;i--);后,变量i 的值为 【 】。 A )10 B )9 C )0 D )1 8、若有int *p1, *p2,k; 不正确的语句是 【 】 A. p1=&k B. p2=p1 C. *p1=k+12 D. k=p1+p2 9、在函数中未指定存储类别的局部变量,其隐含的存储类别是 【 】

实验三 软中断通信

实验三软中断通信 实验目的 1、了解什么是信号 2、熟悉LINUX系统中进程之间软中断通信的基本原理 实验内容 1、编写程序:用fork( )创建两个子进程,再用系统调用signal( )让父进程捕捉键盘上来的中断信号(即按^c键);捕捉到中断信号后,父进程用系统调用kill( )向两个子进程发出信号,子进程捕捉到信号后分别输出下列信息后终止: Child process1 is killed by parent! Child process2 is killed by parent! 父进程等待两个子进程终止后,输出如下的信息后终止: Parent process is killed! 2、分析利用软中断通信实现进程同步的机理 实验指导 一、信号 1、信号的基本概念 每个信号都对应一个正整数常量(称为signal number,即信号编号。定义在系统头文件中),代表同一用户的诸进程之间传送事先约定的信息的类型,用于通知某进程发生了某异常事件。每个进程在运行时,都要通过信号机制来检查是否有信号到达。若有,便中断正在执行的程序,转向与该信号相对应的处理程序,以完成对该事件的处理;处理结束后再返回到原来的断点继续执行。实质上,信号机制是对中断机制的一种模拟,故在早期的UNIX版本中又把它称为软中断。 信号与中断的相似点: (1)采用了相同的异步通信方式; (2)当检测出有信号或中断请求时,都暂停正在执行的程序而转去执行相应的处理程序;(3)都在处理完毕后返回到原来的断点; (4)对信号或中断都可进行屏蔽。 信号与中断的区别: (1)中断有优先级,而信号没有优先级,所有的信号都是平等的; (2)信号处理程序是在用户态下运行的,而中断处理程序是在核心态下运行; (3)中断响应是及时的,而信号响应通常都有较大的时间延迟。 信号机制具有以下三方面的功能: (1)发送信号。发送信号的程序用系统调用kill( )实现; (2)预置对信号的处理方式。接收信号的程序用signal( )来实现对处理方式的预置;(3)收受信号的进程按事先的规定完成对相应事件的处理。 2、信号的发送 信号的发送,是指由发送进程把信号送到指定进程的信号域的某一位上。如果目标进程正在一个可被中断的优先级上睡眠,核心便将它唤醒,发送进程就此结束。一个进程可能在其信号域中有多个位被置位,代表有多种类型的信号到达,但对于一类信号,进程却只能记住其中的某一个。 进程用kill( )向一个进程或一组进程发送一个信号。

停车场管理系统 c语言

2015-2016学年第二学期《高级语言程序设计》 课程设计报告 题目:停车场管理系统 专业:计算机科学与技术 班级:15级计科<1>班 姓名:胡玉玉 指导教师:陈广宏 成绩: 计算机学院 2016 年 4月 25 日

目录 1. 设计内容及要求 (1) 1.1 课程设计内容 (1) 1.2 课程设计的要求 (2) 2概要设计 (3) 2.1 设计思路 (3) 2.2 程序基本框架结构图 (4) 3设计过程或程序代码 (5) 3.1 主要程序代码及解释 (5) 4设计结果与分析 (13) 4.1 程序运行结果截图与分析 (13) 5参考文献 (16)

1.设计内容及要求 1.1 课程设计内容 ①通过本次课程设计,强化上级动手能力,在理论和实践的基础 上巩固《C语言程序设计》课程的学习内容。掌握软件设计的基本方法。 ②熟悉C语言的基本内容从而掌握C语言的基本知识以及了解C 语言的基本编写及运行。 ③了解程序的分模块编写并对程序的每个模块进行详细的设计并 且能理解一般C语言编写的程序。 ④掌握书写程序设计说明文档的能力。 ⑤熟悉C程序设计的开发环境及C程序的调试过程 1.2 课程设计的要求 ①分析课程设计题目的要求。 ②写出详细设计说明。 ③编写程序代码,调试程序使其能正确运行。 ④设计完成的软件要便于操作和使用。 ⑤设计完成后提交课程设计报告。

2.概要设计 2.1设计思路 停车场是一个可停放n辆汽车的狭长通道,并只有一个大门可供汽车进出,汽车在停车场内按车辆到达的先后顺序,依次由北向南排列(大门在最南端,最先到达的第一辆车停放在车场的最北端),如车长内已停满n辆汽车,则后来的汽车只能在门外的便道上等候,一旦有车开走,则排在便道上的第一辆车即可开入;当停车场内某辆车要离开时,在它后进入的车辆必须先退出车场为它让路,待该辆车开出大门外,其它车辆再按原次序进入车场,每辆停放在车场的车在它离开停车场时必须按它停留的时间长短交纳费用,以栈模拟停车场,以队列模拟车场外的便道,按照从终端读入的输入数据序列进行模拟管理.每一组输入数据包括三个数据项:汽车”到达” 或”离去”信息,汽车牌照号码以及到达或离去的时刻(到达或离去的时刻也可用计算机控制).对每一组输入数据进行操作后的输入信息为:如是车辆到达,则输入汽车在停车场。 2.2程序基本框架结构图

广工Anyview试题答案第五章

/********** 【习题5.002】编写程序,利用while语句在同一行中 逐个显示从1至5的数字,每个数字之前保留2个空格。**********/ void main() { int i=1; while(i<=5) { printf(" %d",i); i++; } } /********** 【习题5.003】编写程序,利用for语句在同一行中逐个 显示从1至6的数字,每个数字之前保留2个空格。 **********/ void main() { for(int i=1;i<=6;i++) printf(" %d",i);

} /********** 【习题5.004】n是系统给定的外部整型变量(不需要 自行定义)。编写程序,利用循环语句在同一行中逐 个显示从1至n的数字,每个数字之前保留2个空格。**********/ void main() { for(int i=1;i<=n;i++) printf(" %d",i) ; } /********** 【习题5.012】请仅在程序空缺处填入合适内容,使其 实现功能:依次输入5个整数,计算它们之和并输出。**********/ #include void main() { int i,sum=0,n; for (i=1;i<=5;i++)

{ scanf("%d",&n); sum=sum+n; } printf("sum = %d",sum); } /********** 【习题5.020】n和s是系统给定的外部整型变量(不需要 自行定义)。编写程序,求1到n之间的整数之和,并将结果存放到s。 **********/ void main() { for(int i=1;i<=n;i++) s+=i; } /********** 【习题5.022】n是系统给定的外部变量。编写程序, 求1到n间的自然数之和。请定义局部变量s存放求和 的结果,并用下列语句输出结果 printf("1+2+...+n=%d\n",s);

c语言期末考试及答案讲解

C语言考试模拟试卷 1.若有定义:char c;int d;程序运行时输入:c=1,d=2<回车>,能把字符1输入给变量c、整数2输入给变量d的输入语句是 A、scanf("c=%d d=%d",&c,&d); B、scanf("c=%c d=%d",&c,&d); C、scanf("c=%d,d=%d",&c,&d); D、scanf("c=%c,d=%d",&c,&d); 【答案】D 【解析】scanf()函数中,%d对应的参数是整数型地址,%c对应参数为char 型地址,C,A选项错误;如果输入地址有多个,应该用逗号隔开,B选项错误,故答案为D选项。 2.以下叙述错误的是 A、在进行模块化程序设计的时候,应首先完成每个模块的编写调试,再集中考虑主程序中的算法 B、同一程序各模块可由一组人员同时进行编写调试,可提高编写程序的效率 C、模块化的程序设计是采用自顶向下、逐步细化的原则 D、程序的每个模块都可通过三种基本结构实现 【答案】A 【解析】结构化程序设计把一个复杂问题的求解过程分阶段进行,需要保证自顶向下、逐步细化、模块化设计、结构化编码。进行模块化设计时,首先设计框架,并定义和调试好各个模块之间的输入输出关系,然后完成各个模块的编写调试后

再集中编译,模块化的程序设计采用自顶向下、逐步细化的原则,A选项叙述错误,C选项叙述正确。各个模块可以由不同人员同时进行编写调试,提高编写程序的效率,B选项叙述正确。结构化程序主要由3种基本控制结构组成,顺序结构、选择结构、循环结构,这三种基本结构可以解决任何复杂的问题,D选项叙述正确。故选择A选项。 3.设有定义:int a=0,b=1,c=1; 以下选项中,表达式值与其它三个不同的是 A、b=a==c B、a=b=c C、a=c==b D、c=a!=c 【答案】A 【解析】赋值运算结合性为由右向左结合,赋值运算符左值为变量,右值为变量或常量,且左右两边数据类型相同才能实现赋值。成功实现赋值后以左值为返回值。逻辑表达式成立则返回1,不成立返回0。A选项逻辑表达式a==c不成立(0),则 b=0,表达式值为0。B选项中将c赋值给b,b=1,再将b赋给a,a=1,表达式值为1。C选项逻辑表达式c==b成立(1),则a=1,表达式值为1。D选项逻辑表达式a!=c成立(1),则c=1,表达式值为1。A选项与其他选项不同,A选项正确。 4.设有两行定义语句:

进程软中断通信资料

进程软中断通信 【预备知识】 进程软中断通信涉及的系统调用描述如下。 1.kill() 进程用kill()向一个进程或一组进程发送一个信号。系统调用格式为int kill(pid,sig)。其中,pid是一个或一组进程的标识符,sig是要发送的软中断信号。信号的发送分如下三种情况。 pid>0时,核心将信号发送给进程pid。 pid=0时,核心将信号发送给与发送进程同组的所用进程。 pid=-1时,核心将信号发送给所有用户标识符真正等于发送进程的有效用户标识号的进程。 2.signal(sig,function) 接收信号的程序用signal()来实现对处理方式的预置,允许调用进程控制软中断信号。系统调用格式为signal(sig function),此时需包含头文件signal.h。其中,sig用于指定信号的类型,sig为0则表示没有收到任何信号,其余类型如表所示。 调用函数使用如下头文件: #include 参数定义如下: signal (sig,function) int sig; void(*func) (); function是该进程中的一个函数地址,在核心返回用户态时,它以软中断信号的序号作为参数调用该函数,对除了信号SIGKILL、SIGTRAP和SIGPWR以外的信号,核心自动重新设置软中断信号处理程序的值为SIG_DFL,进程不能捕获SIGKILL信号。 function的解释如下: (1)function=1时,进程对sig类信号不做任何处理便立即返回,亦即屏蔽该类型号。 (2)function=0时,默认值,进程收到sig信号后终止自己。 (3)function为非0、非1类整数时,执行用户设置的软中断处理程序。

停车场管理系统C语言实现1

一.问题描述 1.实验题目: 设停车场是一个可停放n 辆汽车的狭长通道,且只有一个大门可供汽车进出。汽车在停车场内按车辆到达时间的先后顺序,依次由北向南排列(大门在最南端,最先到达的第一辆车停放在车场的最北端)。若停车场内已经停满n辆车,那么后来的车只能在门外的便道上等候。一旦有车开走,则排在便道上的第一辆车即可开入。当停车场内某辆车要离开时,在它之后进入的车辆必须先退出车场为它让路,待该辆车开出大门外,其他车辆再按原次序进入车场。每辆停放在车场的车在它离开停车场时必须按它停留的时间长短缴纳费用。试为停车场编制按上述要求进行管理的模拟程序。 要求:根据各结点的信息,调用相应的函数或者语句,将结点入栈入队,出栈或者出队。 二.需求分析 1.程序所能达到的基本可能: 程序以栈模拟停车场,以队列模拟车场外的便道,按照从终端读入数据的序列进行模拟管理。栈以顺序结构实现,队列以链表结构实现。同时另设一个栈,临时停放为给要离去的汽车让路而从停车场退出来的汽车。输入数据按到达或离去的时刻有序。当输入数据包括数据项为汽车的“到达”(‘A’表示)信息,汽车标识(牌照号)以及到达时刻时,应输出汽车在停车场内或者便道上的停车位置;当输入数据包括数据项为汽车的“离去”(‘D’表示)信息,汽车标识(牌照号)以及离去时刻时,应输出汽车在停车场停留的时间和应缴纳的费用(便道上停留的时间不收费);当输入数据项为(‘P’,0,0)时,应输出停车场的车数;当输入数据项为(‘W’, 0, 0)时,应输出候车场车数;当输入数据项为(‘E’, 0, 0),退出程序;若输入数据项不是以上所述,就输出"ERROR!"。 2.输入输出形式及输入值范围: 程序运行后进入循环,显示提示信息:“Please input the state,number and time of the car:”,提示用户输入车辆信息(“到达”或者“离开”,车牌编号,到达或者离开的时间)。若车辆信息为“到达”,车辆信息开始进栈(模拟停车场),当栈满,会显示栈满信息:“The parking place is full!”,同时车辆进队列(模拟停车

Linux进程通信实验报告

Linux进程通信实验报告 一、实验目的和要求 1.进一步了解对进程控制的系统调用方法。 2.通过进程通信设计达到了解UNIX或Linux系统中进程通信的基本原理。 二、实验内容和原理 1.实验编程,编写程序实现进程的管道通信(设定程序名为pipe.c)。使 用系统调用pipe()建立一条管道线。而父进程从则从管道中读出来自 于两个子进程的信息,显示在屏幕上。要求父进程先接受子进程P1 发来的消息,然后再接受子进程P2发来的消息。 2.可选实验,编制一段程序,使其实现进程的软中断通信(设定程序名为 softint.c)。使用系统调用fork()创建两个子进程,再用系统调用 signal()让父进程捕捉键盘上来的中断信号(即按Del键),当父进程 接受这两个软中断的其中一个后,父进程用系统调用kill()向两个子 进程分别发送整数值为16和17的软中断信号,子进程获得对应软中 断信号后分别输出相应信息后终止。 三、实验环境 一台安装了Red Hat Linux 9操作系统的计算机。 四、实验操作方法和步骤 进入Linux操作系统,利用vi编辑器将程序源代码输入并保存好,然后 打开终端对程序进行编译运行。 五、实验中遇到的问题及解决 六、实验结果及分析 基本实验 可选实验

七、源代码 Pipe.c #include"stdio.h" #include"unistd.h" main(){ int i,j,fd[2]; char S[100]; pipe(fd); if(i=fork==0){ sprintf(S,"child process 1 is sending a message \n"); write(fd[1],S,50); sleep(3); return; } if(j=fork()==0){ sprintf(S,"child process 2 is sending a message \n"); write(fd[1],S,50); sleep(3); return;

大学 C语言 停车场管理系统 设计c语言课程设计 (含调试图)

Xxxxx大学 xxxxxxxxxxx系 20xx-20xx学年第一学期 《C程序设计》课程设计 题目名称:停车场管理系统设计 姓名: 学号: 班级: 指导教师: 编写日期: 20 年1月5日—20 年1月31日 成绩:

目录 (一)需求分析 (3) 1-1停车 (3) 1-2取车 (3) 1-3功能的选择 (3) (二)总体设计(程序设计组成框图) (3) 2-1停车模块 (3) 2-2取车模块 (3) 2-3车辆信息浏览模块 (4) 2-4程序设计组成框图 (4) (三)详细设计 (4) 3-1停车场分析 (4) 3-2停车操作 (4) 3-3收费管理(取车) (5) 3-4车辆信息 (5) 3-5退出系统 (5) (四)程序运行结果测试与分析 (5) (五)结论与心得 (7) (六)参考文献 (7) (七)致谢 (8) 附录: (8)

(一)需求分析 1-1停车 车辆信息要用文件存储,因而要提供文件的输入输出操作。 1-2取车 当车离开时,要删除文件中该车的信息,因而要提供文件的删除操作。 1-3功能的选择 提供现实操作和用键盘式菜单实现功能选择。 (二)总体设计(程序设计组成框图) 2-1停车模块 对车辆信息赋值,分配前检查车位使用情况(按行查找park 数组,元素为0 表示车位为空,则允许分配)。把新添加的车辆信息以追加的方式写入汽车信息文件,并更改汽车信息文件中其他汽车信息的停车时间(停车时间加5)。 2-2取车模块 计算费用(停车费用=停车时间*0.2 元),从文件中删除该车信息。并将该车位对应的二位数组变量设为0,表示该车位可用。输出提示信息:是否输出停车费用总计?(Y/N)如果选择Y,则输出停车费用,否则回到上级菜单。

2016最新广工anyview数据结构答案

【题目】若两棵二叉树T1和T2皆为空,或者皆不空且T1的左、右子树和T2的左、右子树分别相似,则称二叉树T1和T2相似。试编写算法,判别给定两棵二叉树是否相似。 二叉链表类型定义: typedef struct BiTNode { TElemType data; struct BiTNode *lchild, *rchild; } BiTNode, *BiTree; **********/ Status Similar(BiTree T1, BiTree T2) /* 判断两棵二叉树是否相似的递归算法*/ { if(!T1&&!T2)//同为空时,两树相似 return TRUE;

else if(T1&&T1){ if(Similar(T1 -> lchild,T2 -> lchild) && Similar(T1 -> rchild,T2 -> rchild)) //两树都不为空时,判断左右子树是否相似 return TRUE; else return FALSE; }else//以上两种情况都不符合,就直接返回FALSE return FALSE; } /********** 【题目】编写递归算法,求对二叉树T先序遍历时 第k个访问的结点的值。 二叉链表类型定义: typedef struct BiTNode {

TElemType data; struct BiTNode *lchild, *rchild; } BiTNode, *BiTree; **********/ TElemType PreOrder(BiTree T, int &k) { TElemType x='#'; if(T==NULL)return '#'; if(k==1)return T->data; if(T->lchild!=NULL) { k--; x=PreOrder(T->lchild,k); } if(T->rchild!=NULL&&x=='#')

大学C语言期末考试习题集(带详解答案)

一、单项选择题 1.(A)是构成C语言程序的基本单位。 A、函数 B、过程 C、子程序 D、子例程 2.C语言程序从 C开始执行。 A) 程序中第一条可执行语句 B) 程序中第一个函数 C) 程序中的main函数 D) 包含文件中的第一个函数 3、以下说法中正确的是(C)。 A、C语言程序总是从第一个定义的函数开始执行 B、在C语言程序中,要调用的函数必须在main( )函数中定义 C、C语言程序总是从main( )函数开始执行 D、C语言程序中的main( )函数必须放在程序的开始部分 4.下列关于C语言的说法错误的是(B)。 A) C程序的工作过程是编辑、编译、连接、运行 B) C语言不区分大小写。 C) C程序的三种基本结构是顺序、选择、循环 D) C程序从main函数开始执行 5.下列正确的标识符是(C)。 A.-a1 B.a[i] C.a2_i D.int t 5~8题为相同类型题 考点:标识符的命名规则 (1)只能由字母、数字、下划线构成 (2)数字不能作为标识符的开头 (3)关键字不能作为标识符 选项A中的“-”,选项B中“[”与“]”不满足(1);选项D中的int为关键字,不满足(3) 6.下列C语言用户标识符中合法的是( B)。 A)3ax B)x C)case D)-e2 E)union 选项A中的标识符以数字开头不满足(2);选项C,E均为为关键字,不满足(3);选项D中的“-”不满足(1); 7.下列四组选项中,正确的C语言标识符是(C)。 A) %x B) a+b C) a123 D) 123 选项A中的“%”,选项B中“+”不满足(1);选项D中的标识符以数字开头不满足(2) 8、下列四组字符串中都可以用作C语言程序中的标识符的是(A)。 A、print _3d db8 aBc B、I\am one_half start$it 3pai

C语言课程设计报告停车场管理系统

停车场管理一 一.要求: 1.设计一个停车场用长度为N的堆栈来模拟。由于停车场内如有某辆车要开走,在它之后进来的车都必须先退出为它让道,待其开出停车场后,这些车再依原来的顺序进入。 2.程序输出每辆车到达后的停车位置,以及某辆车离开停车场时应交纳的费用和它在停车场内停留的时间。 二、程序中所采用的数据结构及存储结构的说明 以栈模拟停车场,以队列模拟车场外的便道,按照从终端读入的输入数据序列进行模拟管理。栈以顺序结构实现,队列以链表实现。 程序中分别采用了“栈”和“队列”作为其存储结构。 “栈”的定义可知,每一次入栈的元素都在原栈顶元素之上成为新的元素,每一次出栈的元素总是当前栈顶元素使次栈元素成为新的栈顶元素,即最后进栈者先出栈。程序中采用的结构是: typedef struct NODE{ CarNode *stack[MAX+1]; int top; }SeqStackCar; /*模拟车库*/ “队列”是限定所有插入操作只能在表的一端进行,而所有的删除操作都只能在表的另一端进行。插入端叫队尾,删除端叫对头。按先进先出规则进行。程序中采用的结构是:typedef struct Node{ QueueNode *head; QueueNode *rear; }LinkQueueCar; /*模拟通道*/ 三、算法的设计思想 由于停车场是一个狭窄通道,而且只有一个大门可供汽车进出,问题要求汽车停车

场内按车辆到达时间的先后顺序,依次由北向南排列。由此很容易联想到数据结构中的堆栈模型,因此可首先设计一个堆栈,以堆栈来模拟停车场,又每个汽车的车牌号都不一样,这样一来可以根据车牌号准确找到汽车位置,所以堆栈里的数据元素我设计成汽车的车牌号。当停车场内某辆车要离开时,在他之后进入的车辆必须先退出车场为它让路,待该辆车开出大门外,其他车辆再按原次序进入停车场。这是个一退一进的过程,而且让道的汽车必须保持原有的先后顺序,因此可再设计一个堆栈,以之来暂时存放为出站汽车暂时让道的汽车车牌号。当停车场满后,继续进来的汽车需要停放在停车场旁边的便道上等候,若停车场有汽车开走,则按排队的先后顺序依次进站,最先进入便道的汽车将会最先进入停车场,这完全是一个先进先出模型,因此可设计一个队列来模拟便道,队列中的数据元素仍然设计成汽车的车牌号。另外,停车场根据汽车在停车场内停放的总时长来收费的,在便道上的时间不计费,因此必须记录车辆进入停车场时的时间,车辆离开停车场时的时间不需要记录,当从终端输入时可直接使用。由于时间不象汽车一样需要让道,我设计了一个顺序表来存放时间。又用顺序表用派生法设计了一个堆栈,恰好满足上面模拟停车场的需要。 四.设计原理、框图

广工Anyview试题答案-第五章

广工Anyview试题答案-第五章

/********** 【习题5.002】编写程序,利用while语句在同一行中 逐个显示从1至5的数字,每个数字之前保留2个空格。 **********/ void main() { int i=1; while(i<=5) { printf(" %d",i); i++; } } /********** 【习题5.003】编写程序,利用for语句在同一行中逐个 显示从1至6的数字,每个数字之前保留2个空格。 **********/

void main() { for(int i=1;i<=6;i++) printf(" %d",i); } /********** 【习题5.004】n是系统给定的外部整型变量(不需要 自行定义)。编写程序,利用循环语句在同一行中逐 个显示从1至n的数字,每个数字之前保留2个空格。 **********/ void main() { for(int i=1;i<=n;i++) printf(" %d",i) ; } /********** 【习题5.012】请仅在程序空缺处填入合适内容,

使其 实现功能:依次输入5个整数,计算它们之和并输出。 **********/ #include void main() { int i,sum=0,n; for (i=1;i<=5;i++) { scanf("%d",&n); sum=sum+n; } printf("sum = %d",sum); } /********** 【习题5.020】n和s是系统给定的外部整型变量(不需要 自行定义)。编写程序,求1到n之间的整数之和,并将结 果存放到s。 **********/

C语言期末考试试题及答案

个人收集整理-仅供参考 2008-2009学年第一学期期末考试试卷 考试说明:本课程为闭卷考试,可携带书写与修正文具,满分为:100 分. 考试结束后请将后页答题卡与试卷分开上交 ..... 一、单选题<每题2分,共30分) 1.以下叙述正确地是 ______ . A)C程序地每行只能写一条语句 B>语言本身没有输入输出语句 C)在C程序中,注释说明只能位于一条语句地后面 D)在多函数地程序中,main函数必须放在其它子函数地定义之前 2.以下不正确地常量表示形式是 ______ . A> 0.45 B>0XF5 C>‘\85’D> 32.67E-5 3. 以下不正确地变量名是 ______ . A)R&B B> _max C>INT D> SUM3 4. 以下正确地一组语句是 ________. A> int x=y=5; B> int n; scanf("%d",&n>;int a[n]; C> char a,*p; p=&a; D> char s[10]; s="hello"; 5. 若以下变量均已正确定义和赋值,则正确地语句是 ________. A> a=b==5; B> y=x%2.0; C> x+y=10; D> n=8=2*4; 6.下面各组中与给出地程序段功能不等价地是 ________. if(a>0> b=1; else if(a==0> b=0; else b=-1; A>if(a>0> b=1; B>if(a>0> b=1; C>if(a>0> b=1; D>if(a>=0> if(a==0> b=0; else if(a==0> b=0; if(a>0> b=1; if(a<0> b=-1; if(a<0> b=-1; else b=-1; if(a==0> b=0; else b=0; if(a<0> b=-1; 7. 运行下面程序段,若输入abc#,则程序输出是:________. char c;int v1=0,v2=0; while((c=getchar(>>!='#'> { switch(c> { case 'a':v1++; default :v1++;v2++; case 'c':v2++; } } printf("v1=%d,v2=%d\n",v1,v2>; A>2,2 B>3,5 C> 3,4 D>2,5

实验一 进程管理

实验一进程管理 1. 实验目的 ⑴加深对进程概念的理解,明确进程和程序的区别; ⑵进一步认识并发执行的实质; ⑶分析进程争用资源的现象,学习解决进程互斥的方法; ⑷了解Linux系统中进程通信的基本原理。 2. 实验准备 ⑴阅读Linux的sched.h源码文件,加深对进程管理的理解。 ⑵阅读Linux的fork.h源码文件,分析进程的创建过程。 3. 实验内容 ⑴进程的创建 编写一段程序,使用系统调用fork ( )创建两个子进程。当此程序运行时,在系统中有一个父进程和两个子进程活动。让每一个进程在屏幕上显示一个字符:父进程显示字符“a”;子进程显示字符“b”和字符“c”。试观察记录屏幕上的显示结果,并分析原因。 ⑵进程的控制 修改已编写的程序,将每个进程输出一个字符改为每个进程输出一句话,再观察程序执行时屏幕上出现的现象,并分析原因。 如果在程序中使用系统调用lockf ( )来给每一个进程加锁,可以实现进程之间的互斥,观察并分析出现的现象。 ⑶软中断通信 编制一段程序实现进程的软中断通信。要求:使用系统调用fork ( )创建两个子进程,再用系统调用signal( )让父进程捕捉键盘上发来的中断信号(既按Del键);当捕捉到中断信号后,父进程系统调用kill( )向两个子进程发出信号,子进程捕捉到信号后分别输出下列信息后终止:Child process 1 is killed by parent! Child process 2 is killed by parent! 父进程等待两个子进程终止后,输出如下的信息后终止: Parent process is killed! 在上面的程序中增加语句signal (SIGINT, SIG_IGN) 和signal (SIGQUIT, SIG_IGN),观察执行结果,并分析原因。 4. 实验指导

停车场管理系统 C语言实习报告

C 语 言 课 程 实 习 报 告 【要求】 设有一个可以停放n辆汽车的狭长停车场,它只有一个大门可以供车辆进出。车辆按到达停车场时间的早晚依次从停车场最里面向大门口停放(最先到达的第一辆车放在停车场的最里面)。如果停车场已放满n辆车,则后来的车辆只能在停车场大门外的便道上等待,一旦停车场内有车开走,则排在便道上的第一辆车就进入停车场。停车场内如有某辆车要开走,在它之后进来的车都必须先退出停车场为它让路,待其开出停车场后,这些车辆再依原来的次序进场。每辆车在离开停车场时,都应依据它在停车场内停留的时间长短交费。如果停留在便道上的车未进停车场就要离去,允许其离去,不收停车费,并且仍然保持在便道上等待的车辆的次序。编制一程序模拟停车场管理。 【提示】 汽车的模拟输入信息格式可以是:(到达/离去,汽车牌照号码,到达/离去的时刻)。 基本要求:要求程序输出每辆车到达后的停车位置(停车场或便道上),以及某

辆车离开停车场时应交纳的费用和它在停车场内停留的时间。 根据题目要求,停车场可以用一个长度为n 的堆栈来模拟。由于停车场内如有某辆车要开走,在它之后进来的车辆都必须先退出停车场为它让路,待其开出停车场后,这些车辆再依原来的次序进场,所以可以设两个堆栈。 一、需求分析 根据题目要求,程序应该提供“到达/离去,汽车牌照号码,到达/离去”的输入、输出操作;在程序中需要浏览停车场的车位信息,应提供显示、查找、排序等操作;此外还应提供键盘式菜单实现功能选择。 二、总体设计: 根据需求分析,可以将系统的设计分为以下五大模块:(1)车辆进入;(2)车辆退出; (3)车辆等待;(4)车辆查询;(5)退出。 一、详细设计: 主函数中只包含菜单函数,菜单部分单独写成函数,只提供输入、功能处理和输出部分的函数调用,其中各功能模块用菜单方式选择。 [程序] #define N 30 /*等待车辆*/ #define M 20 /*车位*/ #define P 2 /*单位时间所收费用*/ #include #include #include struct cars /*定义车辆信息*/ { char state; int num; int in_time; 停车场 管理系统 车辆进入 车辆退出 车辆等待 车辆信息 显示 车辆查询 退出系统

C语言期末考试复习题及答案

C语言期末考试复习题及答案 一、选择题:下列各题A)、B)、C)、D)四个选项中只有一个是正 确的,请将正确的选项涂写在答案纸上。答在试卷上不得分。 (1)C语言规定:在一个源程序中,main函数的位置 D 。 A)必须在最后B)必须在系统调用的库函数的后面。 C)必须在最开始。。D)可以任意 (2) C语言中的标识符只能由字母、数字和下划线三种字符组成,且第一个字符 A 。 A)必须为字母或下划线。。B)必须为下划线。 C)必须为字母D)可以是字母、数字和下划线中的任一种字符。 (3)下面四个选项中,均是正确的八进制数或十六进制数的选项是 B 。 A)-10 0x8f -011 B) 010 -0x11 0xf1 C) 0abc -017 0xc D) 0a12 -0x123 -0xa (4) C语言中int型数据在内存中占两个字节,则unsegned int取值范围是 A 。 A)0 ~ 65535 B)0 ~ 32767 C)-32767 ~ 32768 D)-32768 ~ 327687 (5) 若有定义:int a = 7; floa x = , y = ; 则表达式x + a % 3 * (int) (x + y) % 2/4 的值是 D 。 A) B) 0.00000 C) D) (6)已知ch是字符型变量,下面不正确的赋值语句是 B 。 A)ch = 5 + 9 ; B) ch= ' a + b '; C) ch = ' \ 0 '; D) ch= '7' + '6' ; (7) 设x , y和z是int型变量,且x = 3, y = 4 , z = 5 则下面表达式中值为0的

实验5 进程间通信实验

实验五进程间通信实验 一、实验目的 1、了解什么是信号。 2、熟悉LINUX系统中进程之间软中断通信的基本原理。 3、了解什么是管道 4、熟悉UNIX/LINUX支持的管道通信方式 二、实验内容 1、编写一段程序,使用系统调用fork( )创建两个子进程,再用系统调用signal( )让父进程捕捉键盘上来的中断信号(即按ctrl+c键),当捕捉到中断信号后,父进程用系统调用kill( )向两个子进程发出信号,子进程捕捉到信号后,分别输出下列信息后终止:Child process 1 is killed by parent! Child process 2 is killed by parent! 父进程等待两个子进程终止后,输出以下信息后终止: Parent process is killed! <参考程序> #include #include #include #include #include int wait_mark; void waiting(),stop(); void main() {int p1, p2; signal(SIGINT,stop); while((p1=fork())==-1); if(p1>0) /*在父进程中*/ { while((p2=fork())==-1); If(p2>0) /*在父进程中*/ { wait_mark=1; waiting(0); kill(p1,10); kill(p2,12); wait( ); wait( ); printf("parent process is killed!\n"); exit(0); } else /*在子进程2中*/ { wait_mark=1; signal(12,stop); waiting();

相关文档
相关文档 最新文档