关闭

关闭

关闭

封号提示

内容

首页 C程序设计语言(第2版·新版)(去掉了可恶的广告).pdf

C程序设计语言(第2版·新版)(去掉了可恶的广告).pdf

C程序设计语言(第2版·新版)(去掉了可恶的广告).pdf

上传者: 惊鸿游龙 2010-12-18 评分 0 0 0 0 0 0 暂无简介 简介 举报

简介:本文档为《C程序设计语言(第2版·新版)(去掉了可恶的广告)pdf》,可适用于IT/计算机领域,主题内容包含CCCCChello,worldC“hello,world#include<stdioh>main(){printf("hello,worldn")符等。

CCCCChello,worldC“hello,world#include<stdioh>main(){printf("hello,worldn")}UNIX“chelloccchellocaoutaoutaouthello,world#include<stdioh>main(){printf("hello,worldn")}mainmainmainprintfnCCCFortranPascalmainmainmainmainmain#include<stdioh>CBmain(){}mainprintf("hello,worldn")"hello,worldn"printfprintf"hello,worldn"printfCnnprintfnnprintf("hello,world")Cprintf#include<stdioh>main(){printf("hello,")printf("world")printf("n")}nnCtb"“hello,worldprintfcc=()()main“hello,world#include<stdioh>*fahr=…*main(){intfahr,celsiusintlower,upper,steplower=**upper=**step=**fahr=lowerwhile(fahr<=upper){celsius=*(fahr)printf("dtdn",fahr,celsius)fahr=fahrstep}}*fahr=…***Cintfahr,celsiusintlower,upper,stepintfloatintfloatintintfloatintfloatCcharshortlongdoublelower=upper=step=fahr=lowerwhilewhile(fahr<=upper){}while(fahr<=upper)(fahr>upper)whilewhilewhile(i<j)i=*iwhileCcelsius=*(fahr)celsiusCprintfprintf……dprintf("dtdn",fahr,celsius)fahrcelsiustprintf……printfCCprintfCANSIprintfCscanfscanfprintfprintfdprintf("ddn",fahr,celsius)fahrcelsiusfahrcelsius#include<stdioh>*printFahrenheitCelsiustableforfahr=,,,floatingpointversion*main(){floatfahr,celsiusfloatlower,upper,steplower=*lowerlimitoftemperatuirescale*upper=*upperlimit*step=*stepsize*fahr=lowerwhile(fahr<=upper){celsius=()*(fahr)printf("ffn",fahr,celsius)fahr=fahrstep}}fahrcelsiusfloatfahr–fahr=lowerwhile(fahr<=upper)intfloatprintfffahrfcelsiusfffddffffprintfoxcsfor#include<stdioh>**main(){intfahrfor(fahr=fahr<=fahr=fahr)printf("dfn",fahr,()*(fahr))}intfahrforprintfCprintffforwhileforwhileforfahr=fahr<=trueprintffahr=fahrfahrfaisewhileforwhieforforwhile#define#define#define#include<stdioh>#defineLOWER*lowerlimitoftable*#defineUPPER*upperlimit*#defineSTEP*stepsize**printFahrenheitCelsiustable*main(){intfahrfor(fahr=LOWERfahr<=UPPERfahr=fahrSTEP)printf("dfn",fahr,()*(fahr))}LOWERUPPERSTEP#defineCgetcharputchargetcharc=getchar()cputcharputchar()cputcharprintfgetcharputcharwhile()C#include<stdioh>*copyinputtooutputstversion*main(){intcc=getchar()while(c!=EOF){putchar(c)c=getchar()}}!=charintintCgetcharEOFendoffilecgetcharccharEOFcintEOF<stdioh>charCCc=getchar()cwhile#include<stdioh>*copyinputtooutputndversion*main(){intcwhile((c=getchar())!=EOF)putchar(c)}whilecwhilewhilewhilemaingetcharwhile!==!==c=getchar()!=EOFc=(getchar()!=EOF)cgetchargetchar()!=EOFEOF#include<stdioh>*countcharactersininputstversion*main(){longncnc=while(getchar()!=EOF)ncprintf("ldn",nc)}ncnc=ncncncncncncnclongintlongintlongintintldprintflongdoublewhilefor#include<stdioh>*countcharactersininputndversion*main(){doublencfor(nc=gechar()!=EOFnc)printf("fn",nc)}floatdoubleprintfffforCforforgetcharwhileforwhieforwhilefor#include<stdioh>*countlinesininput*main(){intc,nlnl=while((c=getchar())!=EOF)if(c=='n')nlprintf("dn",nl)}whileifnlif==CPascal=FortranEQC=====C='A'ASCIIA'A''A''n'ASCII'n'"n"tbUNIXwc#include<stdioh>#defineIN*insideaword*#defineOUT*outsideaword**countlines,words,andcharactersininput*main(){intc,nl,nw,nc,statestate=OUTnl=nw=nc=while((c=getchar())!=EOF){ncif(c=='n')nlif(c==''||c=='n'||c='t')state=OUTelseif(state==OUT){state=INnw}}printf("dddn",nl,nw,nc)}stateOUTINOUTnl=nw=nc=nlnwncn=(nw=(nc=))||ORif(c==''||c=='n'||c=='t')ccctAND||||celseifif()elseifelseelseifif’C#include<stdioh>*countdigits,whitespace,others*main(){intc,i,nwhite,notherintndigitnwhite=nother=for(i=i<i)ndigiti=while((c=getchar())!=EOF)if(c>=''c<='')ndigitc''elseif(c==''||c=='n'||c=='t')nwhiteelsenotherprintf("digits=")for(i=i<i)printf("d",ndigiti)printf(",whitespace=d,other=dn",nwhite,nother)}digits=,whitespace=,other=intndigitndigitCndigitndigltndigitforiif(c>=''c<='')cc''''''''charcharintc''c''''ndigitif(c>=''c<='')ndigitc''elseif(c==''||c=='n'||c=='t')nwhiteelsenotherif()elseif()elsenelseelseifelseelseif()ifelseswitchswitchCFortranPascalCprintfgetcharputcharCFortran**power(m,n)power(m,n)mnnpower(,)xypow(x,y)power(m,n)#include<stdioh>intpower(intm,intn)*testpowerfunction*main(){intifor(i=i<i)printf("dddn",i,power(,i),power(,i))return}*power:raisebasetonthpowern>=*intpower(intbase,intn){inti,pp=for(i=i<=ni)p=p*basereturnp}(){}mainpowerCmainpowerprintf("dddn",i,power(,i),power(i,))mainpowerpowermainpower(,i)ipowerintpower(intbase,intn)powerpowerippowerimainipowerreturnmain

用户评论(0)

0/200

精彩专题

上传我的资料

每篇奖励 +2积分

资料评价:

/46
仅支持在线阅读

意见
反馈

立即扫码关注

爱问共享资料微信公众号

返回
顶部