版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領
文檔簡介
00經(jīng)典程序#include"stdio.hM#definen37voidmain(){inti,kj;fbr(i=l;i<=n;i-H-){fbr(k=1;k<=n-i;k-H-)printグ”);fbr(j=lj<=2*i-lJ++)printグ#”);printfC\n”);#include"stdio.h"http://definen39voidmain(){inti,kj;fbr(i=l;i<=n;i++){fbr(k=0;k<i-1;k++)printグ”);for(j=0ij<2*n-i-k;j4-+)printグ#”);printグ\n”);"C:\Users\libin\AppData\Locaf\Temp\temp429\Debug\noname0.exe-tinnuuunnnnunnnnnnnnnuunnnununnnnnnnnuunnnnnnnnunnnuuuunnnunnnnnnuunnnnnnunnuu
unnnnnnnnnnnnunnnnnnununnnnnununnununnuuunnnnnunnunnnnunnunnunnnnnnunnnnnnu
ununuunutinnnuunnunnunnnunnuunnnunuuunuunuuunnnununuuuununnunuuuunnnunnnuu
nunnnuunnnnnnnunununnnnnnnnnnnnnunuununuunntiuutinunnnnnnuuunnttnnnununuuu
unununnnnnnnnuuunnnnnnnnnunnuuunnnnnnunnnnuunnunnnnuununnnnnnnuununun
nnnnunnnuununnnnnnunnuunnuunnnnnunnnunnnnnnnunnnnunnnunnnnunnnunnnn
unnnnuuuunnnnununtiunnnnnunnnnuunnnunnnnnnnnnunnnnnnunnnununnnunnn
ttnttttttttttnnttnnitnttnttntttttttttttittnttttttttttttttnttnitnttnttttnttnnnitiittttttttttttnttttnttnitn
nnnnnnunununnnnunnnnnnnunnnnnnnnnunnnnuuunuununnnnnnnnnnnnnnn
unuuunnnnunnuuuununntinuunnuuunnunuununuuuuuuuuutiunnnunuuuuu
nnnnnnnnnnnnnnununnnnnuununuunnnunnnnnunnnnnnnunnnunnnnnn
stmitwititititnitstmitnttititattittthstitttanstitita■hhitsstitstitamhitnhhititastttmst
unnnnnnuuunnunnnnuunnnnnuunuunnunnunnnuunuunnnnnnnnnu
uununnttnnnnnuununuunnnuutiuununnnnnnnnuutitinnnnnnnnnn
ttttttnitititttnttitttiiitnnnititttnitnniittnttniiitnttitititttititnititttnttttittttt
itiittttsinititttnititiiiiiiitittiiiitiinsiititiiitiiitiiiisiittitittttitiiiiiittitttntttt
nnnnnuuunuunnunnnnnuuunnutinnnnnnuntinnnunununn
unnnnnuuuuunnnunnnnnununnunnnunununnuunnnnn
nnnnnnnnuununnnnnnnnnnnnunnnnnnnnnunnnunn
nunuuunnnutiu?ununuunnunnuuunnunnnnnnnun
ttttnttttttttitttitttitttitttttttttttttittttiitititittttttsttttttttttitit
uitttttittiitiiitttitttitnttttttnitttniittitititttitnttttitititit
nnnnunnnuununnnnununnnnnnnunnuunn
nnuununnnnnnnunnnunnnnnnnnuunun
nnuuunnnnnnnnnnunnnunnnnunuuu
nunnnnnnnnnnnunnnunununnnun
nnnnnnnnuuuununnnnuntinunu
nnnnttttnntittttttnttttttnitnntttttt
nnnunnnnnnunnnnnnnnnn■it?!thmstnitnmsna■i!wh
ititititttttttttitttitttitttttiitt
nnnnnnnnnunuuun
niittiitiitnttttttMiiii
nnnnnnuuunn
nuunnnuun
nnnnuuu
nnnnu
nnit*im?ssanykeytocontinue#include"stdio.h"http://definen40voidmain(){inti,kj,c;fbr(i=l;i<=n;i-H-){fbr(k=0;k<i-1;k++)printグ*");Cr(j=0J〈2*n-i?k;j++)printグ#,');fbr(c=1;c<=i-l;c-H-)printf("*");printf("\nM);
/*Note:YourchoiceisCIDE*/#include"stdio.h”#definen78 /?必須是奇數(shù)?/voidmain(){inti,k,j,m;m=(n-l)/2;fbr(i=0;i<=(n-l)/2;i++) /?先輸出(n?l)/2+l行,即i從。開始?/{fbr(k=O;k<m;k-H-)primff");m—;fbr(j=0J<=2*i;j++)prints”#");printffW”);fbr(i=l;i<=(n-l)/2;i++) /*輸出(n?l)/2行,即i從1開始,看看與上面對比?/{fbr(k=1;k<i+1;k++)printfT”);for(j=0y<n-2*i;j++)prmtf(M#");printfCM");?,G\U$er$\libm\AppD?ta\Locd\Temp\temp714\Debug\nonameO.Me,mmititiitttiitiiiitittttitiiiitttaitBBBBBBBMBBBBBBBBIIItBBBBBBBBBBBItBB?BBBBBKBBItBBBBBBBBBItBBBBBBBBBBBItBBBBBBBBBBBBBNBBBBBBBBBNBBBBBBBBBBBMBBBBBltBBBBBBBBBttBBBBBBBBBItBBBBBBBBBBBItBBBBBUBHBBBBBBHBMBBBBBBBBMBBItBBBBBIIBBMBBBBBMBNBBBBBBItBItltBBBBBBBBMBHqBBBBBIIBBItltBBBBBBBMBMBBBBBItBMBBBBBBBBMB&BBBBBBIIBBMBBBBBBBBBMBBNBBBBBBBBBNBBBBBBBBNItBBBBBBBBItBBItBBBBBBBBBBBBNBBNBBBBBBBBBNBBBBBBBBN0BBBBBBBBBBBNBBBBBBBBBIIBBBBHBBItBBBBBBItBBIIBBBBBBBBBIIBBBBBBBBBBBItBBBBBBBBBItBBBBBBMBBHBBBBBBItBBIIBBBBBBBBIIIIBBItBBBBBBBBItBBBBBBBBBIIBBBBBBBBNBBNBBBBBBItBBItBBBBBBBBBItBBBBBBBBItBBMBBBBBBBBNBBItB8BBBB8ttBBttBB88BBttBBttBBB8BBBBItttB898BBBBBBBItBBBB8B8BBItBBtt8B88B88881t88888888888888888881188888888888808888888B8118888888888888811888888888888N888888881t888888888N8808888888881188888888888888881t8888888888888888888888888888888888N888888888118888888888888888881t8888888888888888888888888888888888888888888811888888888888888888881t88888888888888888888888888888888888888888881t888888888N881t888888888W88888888888M88888888881t888888888B8118888888880888888888888881t888888888M8888888888M88888888M888888888881t88888888M8888888888888888It8888888881t88888888888M888888881t8888888888881t888888888M88888888881t88888888888888881t88888888888V888888881188888888888888888888881t8888888888888,888888888888888888888888888888888888881t88888888888888888888881188888888888£8888888888888888881t888888888888888888888N888888888888888888888H8888888888888888888888888888888888888888880888888888888888888888888888888N88888888888M888888888888888H88888888888N88888888888888888881t888888888888H88888888888888888888888881t888888888881111888888881188888888811881t888888888H88888888888881t88888888811888888888881t888888888NN888888888811888888888118888888888/*Note:YourchoiceisCIDE*/#include"stdio.h"#definen77 /?此處必須是奇數(shù),記住是必須,否則亂套?/voidmain(){inti,kj,m,h;m=(n-1)/2;fbr(i=O;i<=(n-1)/2;i++){for(k=O;k<m;k-H-)prin-"”);m??;fbr(j=0u<=2*i;j++)prints”#");fbr(h=O;hv=m;h++)printfl(H*");printfCV);fbr(i=l;i<=(n-l)/2;i++){fbr(k=1;k<i+l;k++)printグ*”);fbr(j=0j<n-2*ij4-4-)printグ#");for(h=l;h<i+l;h++)printグ*”);printグ\n”);■'i"C:\Users\libin\AppData\Local\Temp\temp714\Debug\noname0.exe-x*********~****************ttttwmtttititww itititititit***???**??■xxxxxxxxxxxxxxxxxxxxxxxxxttttttttttltttttstttttttttstttttttsttiltttttltttttttttXXXXXXXXXXXXXX-XXXXXXXXXxxxxxxxxxxxxxxxxxxxxxxxxltMttttMltttltltltttltttltMftltltltMttVItttltltitltxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx|twitttttlttt|t|ttttt”tttttttttt|ttttt|t#ttwttttttttttxxxxxxxxxxxxxxxxxxxxxxx**********-********?*******?ttttttttttittttttttttttttttttttttttttttttttttttttttttttttttttttt?*******-**********<******-***********-**?***??-??*?*X************~*******MItttMItIt龔MItItWttItItItMtt龔|tMttItItItIt龔其MItItIt龔tt.券****?**??***?*?****?****?*-*******************ttIttttttttttttttttiltttItttItttttItttttIt穌itHttItWt?ttttItItWItttItItx*******************荘?***************ItM”tt尊!tItM”!iI!龔!tIt?tItttI*龔”tt龔?ttt其龔titt龔!t典龔!tItttttMtttt龔|tttItMI****************?*****???*?**ttstitttttitttttttttttttitttttttttstttttstitttitttttttnttititttttstitttttttttttttttititttsttttttt****************************ItItItItItItItItititItItItItItItttItItItItItItItttitItItItItItitItitItItitItItItttItititItItItitItIt**************-?^M*M*M*??^**ltttllttttltttltltltttttttttltttttttttltttttltttttltltttltltttttltttttltttttlttttlttttltltttltttttttltltlt*******>?****************ttltttttttttttltltlttttttlttltttltttltttltttttlltittllttltttttltttttttltttttttttttttttttlttttttttttlttttttttlt***-M-M-M^?-^M-M-?**********tiititititftitttitititititttttititititttitititititititititttttttnititttttitttittttiltitititttitttitittiltitittilt***********-K-*?-?^-M-**ttItItitItItttItItItItItItItItItItItItItItItItItItItItItItItItItItftItItftftItItItItItItItItItItItItftItItItItItItItIt??-?********?*M-*<-*^?H*ttttttttttttttttttttttttttttttttttttltttttttttltttttttttttttttttttttlttttttttttttttttttttltttttttttttttttttttttttttltttt#**?*********M**ttltttttltltltttttttttltttltttttttttttttlttttlltltttttttltttltttttltltttttltlttttttttttttttttttttttlttttttttltttttltltttttttlt**********M*?tlltltttltttttlltlltttttllttltttltttttltttltltftltltltttttlittttltltltttltttitltttltltttitltttttttltltltltttltltltltltltitttttltttM********^-*ttttttttttttttttttltttttttttltltttttttttttttttttttttltttttttltttltttttttltltttttltttltttttttttttttltttttltltttttttltltttltttttlttttttt*********1111ItItItItItItItIttiltItItIttiltItItItItIttiltItItItitItItItItUttItItUtttiltItItHUItItItItItItItItItItItItItUttItItItItHitItItItIt****?**uunuuunnnuunnuununuuunuuuunnnnununHuuuuuuuuununuunKuununnuuuunuuuunuuuu?***?ttnttttttttititttitttttitttttttHttitittttittitttitttttttitttnttttititttttHnnuuuuuunuunnnnnununuuuunuunuuunuu*M?HHUuuuuuuunuuunununuuuunuuuuuuuuuuuuunuuununHuuuuuunuuuuuuuuunuunuuunuuuuun*ttttttHnnunnnuuuHuunuunuuuuHnHUUHHHnHnHnHUHunnnHUHUHUHUHUuuuunnuuuHunuuHHnuHUHnH?ttHununnnuunnHuuunuuuHuuuuuuHnHHHnnuuunuunHuuuuununnuuuuuuuuunnuuuuuuHHUHUuu***uuuuuuuuuunuuuuuuuuunuuuuuuuuuuuunuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu*****HnHUUUUUHUUHHUUHUUUUUHUHUUUUnUUUUUHHnUUUHUHUUUHUnUUUUUUUUUUUUUUUUUnUHUU***^MMMMttttttHnnHunnHHnHnnunHHnnnnnnnnnnnnnnnHnHnnnnunHHnnnnnnnnnnnnHnnnnHnnnnn********H?ttltltHHHHItltttHllttHHHttttttHHttltltHHHHHHHItHttHltHHItttHHUUUUUnunnnUUnUUUUUUUUUUUn?^**********uuuuunuuuuuuunnuuuuuuuunuuuunuuuuuuuuuunuuunuuuuuuuuuuuHuuHuuuuuH******X”XXM*MttHttttttHttHHtttttttlttHttttttHttllttttttHttltttttHHHHHHUUUHHHHHUHHUHHHHUHHHHHHHHHnU********M**MM*??HHUHHUHHUnnUHHHnHHUHHUHnHHHHUHHUHHnHUHHHHHUHUUnnHUHHnHHHUHHUH**********->?*M-?^***HHHHHHUHHHHHHHUUUUUUUnUUUUnUUUnUUUUUnUUUUUUUnUUUUUUUUUUnunU***********w*******uuunnKUUHUHUuuunuHHUHUuuuHuuuuuHHnnHuunuuuuHUHUuuuuuHnnuu****?*****MMMMMMMMMMMttHttHHItttHHttttttttttHttHHtlttHtlttttHHttHHttHltttttHttltttttttHHHItttttttHlttlttHHnH***********************uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu***************m*m-m^******HHHHHUUUHHHUUHHHHHUUHUHHHHUUUUUUUUUUUUUUUUUUUUUUUUH?***********************M**HHUHUUUHHHHHUUnUUUUnHHHHHUUnHnnUHUHHnUUUUUHUHHUUn****M-M-M-M-M*w******************itHUHIt&ItItHnHMMHitItHMItftMHUnnnHHMMItHItItHItItHUHnHItHHMH*****************??*******?****uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu*********-?*******/*Note:YourchoiceisCIDE*/#include"stdio.hH#definen25voidmain(){inti,k,j,m,h;m=(n-l)/2;h=65;fbr(i=0;i<=(n-l)/2;i++){fbr(k=O;k<m;k++)printff");m-;for(j=0u<=2*iy++)printグ%c”,h);h++;printf(M\n");}fbr(i=l;i<=(n-l)/2;i++){fbr(k=l;kvi+l;k++)printff”);fbr(j=0;j<n-2*i;j++)printf(M%cM,h);h++;primffW”);百"C:\Users\libin\AppData\LocaKTemp\temp714\Debug\noname0.exe" |o||B||i£^i|BBB
CCCCC
DDDDDDD
EEEEEEEEE
FFFFFFFFFFF
GGGGGGGGGGGGG
HHHHHHHHHHHHHHH
IIIIIIIIIIIIIIIII
JJJJJJJJJJJJJJJJJJJ
KKKKKKKKKKKKKKKKKKKKK
LLLLLLLLLLLLLLLLLLLLLLLNNNNNNNNNNNNNNNNNNNNNNN000000000000000000000PPPPPPPPPPPPPPPPPPPQQQQQQQQQQQQQQQQQRRRRRRRRRRRRRRRSSSSSSSSSSSSSUUUUUUUUU
UUUUUUU
wwwww
XXX
丫
Pressanykeytocontinue/*Note:YourchoiceisCIDE*/#include"stdio.h"#definen25voidmain(){inti,kj,m,h;m=(n-l)/2;h=getchar();fbr(i=O;i<=(n-1)/2;i++){fbr(k=O;kvm;k++)prints"”);m-;for(j=0j<=2*ij++)printff%c”,h);h++;printffW”);}fbr(i=l;iv=(n?l)/2;i++){fbr(k=1;k<i+l;k++)printff”);fbr(j=0y<n-2*ij-H-)printff%c”,h);h++;printf(u\n"); Configuration:nonaneO-Win32Debug/*Note:YourchoiceisCIDE*/#include"stdio.hM#definen25voidmain()inti,kj,m;charh=,A,;/?一般先定義字符竄,否則報錯,謹記!*/m=(n-l)/2;fbr(i=0;i<=(n-l)/2;i++){fbr(k=0;k<m;k++)printグ");m-;for(j=0J<=2*ij++)printff%c”,h);h++;printffW”);fbr(i=l;iv=(n?l)/2;i++){for(k=1;k<i+l;k++)printf,”);fbr(j=0j<n-2*ij4-4-)primff%c”,h);h++;/*Note:YourchoiceisCIDE*/#include"stdio.h”#definen79/?此處必須是奇數(shù),記住是必須,否則亂套?/voidmain()inti,k,j,m,h,S,N;m=(n-l)/2;S=N=0;printf("***********、(ノ_し)廣************w");fbr(i=O;i<=(n-1)/2;i++){fbr(k=O;k<m;k++){printff@");S++;}m-;fbr(j=0;j<=2*i;j++){printf("A");N++;)fbr(h=O;h<=m;h++){printff@");S++;}printf("\n");)fbr(i=l;i<=(n-l)/2;i++){fbr(k=1;k<i+1;k++){printf("@");S++;)for(j=0;j<n-2*i;j++){printf("A");N++;}for(h=l;h<i+l;h++){printグ@");S++;}print^"\n");共有%d"@”共有%d"@”有%d“ハ”*******************w”gnゝ?print"”***********、(ノVシ)1************\i"i'')?/*Note:YourchoiceisCIDE*/#include"stdio.h"^definen79/?此處必須是奇數(shù),記住是必須,否則亂套?/voidmain()inti,k,j,m,h,S,N;m=(n-l)/2;S=N=0;printf("\n");*******\n");*******\n");printf1--ー》ー個小程序<-*******\n");printf('\n\n");printf("");printf(*\n*);printfC
一”);printf(*\n);for(i=0;i<=(n-l)/2;i++){for(k=0;k<m;k++){printf("@");S++;}m--;for(j=0;j<=2*i;j++){printf(“つ;N++;}for(h=0;h<=m;h++){printf("@");S++;}printf("\n");for(i=l;i<=(n-l)/2;i++){for(k=l;k<i+l;k++){printf("?*);S++;)for(j=0;j<n-2*i;j++){printf("");N++;)for(h=l;h<i+l;h++){printf("@");S++;}
printf("\n");printf(--");printf("\n");*******\n");printf("printf*******\n");printf(" 》ー共有%d個“@”ー共有%d個“\n",S,N);*******\n");printf("\n");SBC:\Windows\system32\cmd.exe0PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP0PPPPPPQPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP"PPPPPPPPPPPOPPPPPPPPPPP0P0PPPPPPpeepeeeeeeppppeeeeeppppeeeeeeeeeeeeee^^^^^eepeppppeeeeepppeeeeeeeeeeeeeeeeeeeeeqppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp◎pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppQPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP0ppppppppppppppppp0pppPppeeeeppppppeeppppppppppeppppeep0(?00000(?00hh000Q000000(?p((?p(?e(?epe(?pe(?epee(?p(?(?eeepppppppppppppppppppppppppppppppppppppppppppppppppp@ppppppppppppppppppppppppppppppppppppppppppppppppppppppp1pppppppppppppppppppppppppppppppppppppppppppppppppp@ppppppppppppppppppppppppppppppppppppppppppppppppppppppp10jpeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee^^^^^^^^^eeeeeei0(?(?@@@(?@(?(?0@(?(?@0(?@@(?(?@0(?0@(?(?@(?(?0@(?(?P(?0(?@(?("ieeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee^^^^^eeeeeeetieeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee^^^eeeeeeeeeapeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeep^eepeeeeeeth金面計算機網(wǎng)絡I計算機UB!N鬃統(tǒng)文件夾、網(wǎng)咨Ki號文件夾文件名00:保存類2JCT): |JTC文件G》ー共有3120個“?!`共有3121個Ixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxh青按任意鍵繼續(xù)../*Note:YourchoiceisCIDE/*Note:YourchoiceisCIDE*/?求枳分a到b,sin(x)的積分?#include"stdio.h"#include"math.hM//defineq10000voidfiin(doublea,doubleb){doubleh,s,t;inti;h=fabs(b-a)/q;s=(sin(a)+sin(b))/2.0;fbr(i=1;i<=q-l;i++){t=a+i*h;s+=sin(t);}printf(M%f\n,,,s*h);}//undefqvoidmain(){doublen,m,q;q=l;scanff%lf%lF,&m,&n);fiin(m,n);printf(M%f\nM,q);■iL:\user5\iiDin\uesiCTop\ueDug\cppi.exe0.01.50.9292631.000000Pressanykeytocontinue#include<stdio.h> 〃小寫轉換大寫,大寫轉換小寫charfun(char);voidmain(){charch;while((ch=getchar())!=,\n,){ch=fun(ch);putchar(ch);charfun(charch){if(ch>=,a,&&chv'z')(return(ch-32);)if(ch>=,A*&&ch<*Z*){return(ch+32);}}abcdefghijknopqRSTUUABCDEFGHIJKMOPQrstuuPressanykeytocontinue#include<stdio.h>charfun(char);voidmain(){charch;intn;n=0;while((ch=getchar())!=,\n,)(一ch=fun(ch);putchar(ch);n-H-;}printf("\n\n\n\n%d”,n); /?輸出字符的個數(shù)?/1charfun(charch){if(ch>=,a,&&chv'z')return(ch-32); /?或者是return(ch+'A'-'a');*/if(ch>='A'&&ch<Z){return(ch+32); /?或者是return(ch-'A'+W);*/}elsereturnch;abcDEF12323456987789ABCdef1232345698778920Pressanykeytocontinue)■?卜ff>a-b,z-a,B-A,A-Z;//include<stdio.h>charfun(char);voidmain(){charch;intn;n=0;while((ch=getchar())!=\n')ch=fiin(ch);putchar(ch);n-H-;)printfi(,,\n\n\n\n%d\nH,n); /*輸出字符的個數(shù)?/)charfun(charch){ifi(ch>=,a,&&chv'z){if(ch>=,a,&&ch<y)return(ch+1);elsereturn'a';}ifi(ch>=,A,&&ch<,Z,){ifl(ch>=B&&ch〈Z)return(ch-1);elsereturn2’;elsereturnch;abcdABCD1234hcdeZABC123412Pressanykeytocontinue求1+1+2+1+2+3+1+2+3+4+ 的和是多少/*Note:YourchoiceisCIDE*/#includenstdio.hnintfun(intn){inti,s;s=0;fbr(i=l;iv=n;i++)s+=i;returns;}voidmain(){inti,s;s=0;for(i=l;i<=3;i++)s+=fim⑴;printグ%d”,s);171700Pressanykeytocontinue求l+I+l/2+l+I/2+,3+l7/2+L3+l/4+ 的和/*Note:YourchoiceisCIDE*/#include"stdio.h"#defineP100doublefun(intn){inti;doubles=0;fbr(i=l;iv=n;i++)s+=(1.0/i);returns;}voidmain(){inti;doubles=0;fbr(i=l;i<=P;i-H-)s+=fUn⑴;
printff%1s);423.925129Pressanykeytocontinue,■是不是,數(shù)問題/*Note:YourchoiceisCIDE*/#include”stdio.h”intfun(intn){inti;fbr(i=2;i<=n/2;i++)ifi(n%i==0)return0;return1;voidmain(){intn;scanf(H%dn,&n);n=fun(n);if(n=0) printf("不是素數(shù)”);else printズ是素數(shù)”);}不是素數(shù)Pressanykeytocontinue是素數(shù)Pressanykeytocontinue1+1+2+1+2+3+1+2+3+4+…的和是多少/*Note:YourchoiceisCIDE*/#include”stdio.h”intfiin(intn){ints=O,t=l;inti;fbr(i=l;i<=n;i++,t+=i)s+=t;returns;)voidmain(){ints,n;scanf(”%d”,&n);s=fun(n);printf("%d1s);310Pressanykeytocontinue/*Note:YourchoiceisCIDE*/includeHstdio.hndoublefun(doublen){doubles=O.O,t=l.O;inti;fbr(i=l;i<=n;i++,t+=l.0/i){s+=t;)returns;}voidmain(){intn;doubles;scanf(n%dH,&n);s=fiin(n);printff%口s);)IfufaiI\lhiIi1000087885.847966Pressanykeytocontinue/*Note:YourchoiceisCIDE*//include“stdio.h”intfun(intn){ints=O,t=l;inti;fbr(i=l;i<=n;i++,t*=i)s+=t;returns;)voidmain(){ints,n;scanff'%d",&n);s=fun(n);printf(M%dH,s);1143954713Pressanykeytocontinue.1-1/2+13-1/4+1/5-1/6+……/*Note:YourchoiceisCIDE*/#includeHstdio.hndoublefun(doublen){doubles=0.0;inth=l;inti;for(i=1;i<=n;i++) /?此時可以不用h,用i就可以了?/{ifi[h%2==0)s-=1.0/i;elses+=1.0/i;h++; /*h++可以刪?/)returns;}voidmain(){intn;doubles;scanf(n%dM,&n);s=fun(n);printf(M%f;s);j/*Note:YourchoiceisCIDE*/#includeセtdio.h"doublefun(doublen){doubles=0.0;inth=l;inti;fbr(i=l;iv=n;i++){if(h%2!=0)s+=1.0/i;elses—1.0/i;h++;}returns;ivoidmain(){intn;doubles;scanff'%d”,&n);s=fun(n);printff%ロs);70.759524Pressanykeytocontinuel-l/(2*2)-l/(3*3)- /*Note:YourchoiceisCIDE*/#includeセtdio.h"doublefun(intn){doubles=1.0;inti;fbr(i=2;i<=n;i++){s-=1.0/(i*i);)returns;}voidmain(){intn;doublei=3.0/4.0;doubles;scanfifn%dn,&n);s=fun(n);printf(H%f%f',s,i);20.7500000.750000Pressanykeytocontinue交換兩個數(shù)的值/*Note:YourchoiceisCIDE*/#includenstdio.hnvoidfun(int*n,int*t)voidmain(){intn,t;scanf(n%d%dH,&n,&t);fun(&n,&t);printfT'%d%d”,n,t);11221122Pressanykeytocontinue/*Note:YourchoiceisCIDE*/#include“stdio.h”voidfiin(int*n,int*t) /?對比紅色部分?/I■:*■■:?1?:voidmain(){intn,t;scanff'%d%d”,&n,&t);fun(&n,&t);printf(n%d%dn,n,t);11222211Pressanykeytocontinue把輸入的數(shù).,按從大到小排#include"stdio.h"voidmain(){inta[4];inti,j,t,p;fbr(i=0;i<4;i++) scanf("%d",&a[i]);i=O;for(j=0;j<3J-H-){P=j;fbr(i=j+l;i<4;i++)if(a[i]>a[p])p=i;if(p!=j){t=a|j];a[j]=a[p];a[p]=t;}}for(i=0;i<4;i++)printf("%d",a[i]);}2678924592784526Pressanykeytocontinue#include"stdio.h"voidmain(){inta[4];inti,j,t;for(i=0;i<4;i++) scanf("%d",&a[i]);i=O;fbr(j=O;j<3j-H-)/*a[j]從零開始,到3一直是從大到小?/for(i=j+l;i<4;i++)if(a[i]>a[j]) {t=a[j];a[j]=a[i];a[i]=t;})for(i=0;i<4;i++)printf("%d",a[i]);123567789234789567234123Pressanykeytocontinue把輸入的數(shù)字按從大到小排#include"stdio.h”,n=rand()%x;n將得至リー個〇include“stdlib.h”,n=rand()%x;n將得至リー個〇到x?l的隨機整數(shù)?/voidmain(){inta[50];inti,j,t;fbr(i=O;i<5O;i++) a[i]=rand()%100;printff 轉 換 前 :\n");for(i=0;i〈50;i++)printf(((i+l)%10=g))?"%4d\n”:“%4d”,a[i]);for(j=0;j<50;j++)/*a[j]從零開始,至U3?直是從大到小?/(fbr(i=j+l;i<50;i++)if(a[i]>a[j]) {t=a[j];a[j]=a[i];a[i]=t;}}printf("轉換后:'n");fbr(i=0;i<50;i++) printf(((i+l)%10==0)?"%4d\n":"%4d",a[i]);41673406924785862645458127619195422736914253928221161895472671386912679935943112233736441115368轉換后:99959594929191828178737169696867676464626158535347454241413836353433272726242221181612111154320#include"stdio.h"#include"stdlib.h"/*隨機調用函數(shù)的頭文件stdlib.h,n=rand()%x;n將得至リー個〇到x-1的隨機整數(shù)?/voidmain(){inta[10][10];inti,j,t;fbr(i=0;i<10;i++) for(j=0j<10y++)a[i][j]=rand()%1000;printff轉換前:\n"); fbr(i=0;i<10;i++) fbr(j=0J<10;j-H-)printf(((j+l)%10==0)?"%4d\n":"%4d",a[i][j]);fbr(i=0;i<10;i++)(for(j=0;j<i;j-H-){t=a[i]U];a[i]U]=aU][i];aU][i]=t;}}printf("轉換后:'n");fbr(i=0;i<10;i++) fbr(j=0J<10j++)printf(((j+l)%10==0)?"%4d'n":"%4d",a[i][j]);
4146733450016972447835896246470514528182796149199594282743639160490215329238242171671889544772677153886991266729935894703811322333673664141711253868547644662757378597237415297783163519084228810640942264648446805890729370350610139354862962384954756840966376931308944439轉換后:62632353753811882929541417053914477035473164466299444671456047268116443580562343933428190277132266219089084626500827153538333757842729954323169961292869673372883707565377244913829126648591063508405384789954216671417234069661183589427162997117419421013768296282771835253529264393931929464436895894868778648548308541#include"stdio.h"http://include"stdlib.h"/*隨機調用函數(shù)的頭文件stdlib.h,n=rand()%x;n將得到ー個〇至リx-l的隨機整數(shù)?/voidmain(){chara[10][10];inti,j,t;ft)r(i=0;i<10;i++) for(j=0y<10y++)a[i][j]=rand()%10;printff,轉換前:\n"); fbr(i=0;i<10;i++) fbrG=0;j<10;j++)printf(((j+l)%10==0)?"%4d\n":"%4d",a[i][j]);fbr(i=0;i<10;i-H-)for(j=0;j<10;j++){if(j<i)a[i][j]=O;ifO>i)a[i]U]=l;}
printR"轉換后:'n");fbr(i=0;i<10;i++) fbr(j=0;j<10;j++)printf(((j+l)%10==0)?"%4d\n":"%4d",a[i][j]);1740948824551711527614232216857618927954312334113874277931986502860248650900613893446066184963788291轉換后1111111111051111111100211111110008111111000031111100000911110000000111000000011100000000110000000001[?リ對角線為冬//include"stdio.h"http://definen10#include"stdlib.h"/*隨機調用函數(shù)的頭文件stdlib.h,n=rand()%x;n將得到?個〇到x-1的隨機整數(shù)?/voidmain(){chara[n][n];intij;for(i=0;i<n;i++)for(j=O;j<n;j++)a[i][j]=rand()%100;printff轉施前:\n");for(i=0;i<n;i++) fbr(j=O;j<nJ++)printf(((j+l)%n==0)?"%4d\n":"%4d",a[i][j]);for(i=O;i<n;i-H-)if(i=j){a[i]U]=0;a[i][(n-l)-i]=0;)printf("轉換后:\n");fbr(i=0;i<n;i++)for(j=0y<nj++)printf(((j+l)%n=0)?"%4d\n":"%4d",a[i][j]);41673406924785862645458127619195422736914253928221161895472671386912679935943112233736441115368474462573759234129781635904288640426448465902970506 19348292384545640667631844392623373818822941轉換后:0673406924785862050812761919542036914053928221 01895472671069120993594311223300411153684744625700234129781635900886042644846502970506 0934829084545640667608039262337381882290—?//include"stdio.h"http://definen10#include"stdlib.h"/?隨機調用函數(shù)的頭文件stdlib.h,n=rand()%x;n將得到?個〇至リx-1的隨機整數(shù)?/voidmain(){chara[n][n];inti,j;for(i=0;ivn;i++)fbr(j=O;j<n;j++)a[i][j]=rand()%100;printff轉施前:\n");for(i=0;i<n;i++) fbr(j=O;j<ny-H-)printf(((j+1)%n==0)?"%4d\n":"%4d",a[i][j]);for(i=O;i<n;i-H-)a[i][(nl)-i]〇|printf("轉換后:\n");fbr(i=O;i<n;i-H-)fbr(j=Oj<n;j++)printfi(((j+l)%n=0)?"%4d\n":"%4d",a[i][j]);Ihi1]對角線為?#include"stdio.h"#definen10//include"stdlib.h"/?隨機調用函數(shù)的頭文件stdlib.h,n=rand()%x;n將得到個〇到x-l的隨機整數(shù)?/voidmain(){chara[n][n];intij;for(i=0;i<n;i++)for(j=O;j<n;j++)a[i][j]=rand()%100;printff轉頻前:\n");fbr(i=O;i<n;i++) fdr(j=O;j<n;j++)printf(((j+l)%n==0)?"%4d\n":"%4d",a[i][j]);for(i=0;i<n;i++){a[i][i]=0;a[i][(nl)-i]0;|printf("轉換后:\n");/*MHHi*/for(i=0;i<n;i++)fbr(j=O;j<nj++)printf(((j+l)%n==0)?"%4d\n":"%4d",a[i][j]);
轉換前:41673406924785862645458127619195422736914253928221161895472671386912679935943112233736441115368474462573759234129781635904288640426448465902970506193482923845456406676318443926233738188229413315395843077673862145247270297773971286906136556755743152505041246630791737578753834599582188224663013680916255105924374883954125091367420962148996884813453991838088276728934883721101713149163551049195698324844989295859343238714348轉換后:0673406924785862645458127091042273691425392822116095472603869126799359431103373644111068474462573759041297816359042064042644805902970506193480238454040667631844392623373808204133153958430776738621450727029777397128690613655670740525050412466307917370875383099582188224663006809162550592437488395410509136742096210996884813409918380882767289308372101713149163551049195603084498929585934323871430四周?符為,#include"stdio.h"#definen10//include"stdlib.h"/?隨機調用函數(shù)的頭文件stdlib.h,n=rand()%x;n將得到?個〇至リx-1的隨機整數(shù)?/voidmain(){chara[n][n];intij;fbr(i=0;i<n;i++)fbr(j=O;j<n;j-H-)a[i][j]=rand()%100;printf("轉換前:\n");fbr(i=O;i<n;i++) for(j=O;j<n;j-H-)printf(((j+l)%n=0)?"%4d\n":"%4d",a[i]g]);fbr(i=0;i<n;i-H-)fbr(j=O;j<n;j-H-)if(i=O||i==n-l|[j=OHj==n-l)a[i][j]=O;printf("轉換后:\n");fbr(i=0;i<n;i++)for(j=O;j<n;j++)printf(((j+l)%n==0)?"%4d\n":"%4d",a[i][j]);416734069247854581276191959142539282214726713869126731122337364414744625737592316359042886404659029705062923845456406644392623373818轉換后ス00000000458127619195042539282210267138691267011223373644104462573759230359042886400590297050602384545640660000000轉換前:6264273618953594536829786448934831 829410 027 018 035 053 029 064 093 031 00 0584216991141421768204216991141421760//include"stdio.h"#definen37voidmain(){inti,k,j;charch-A1;fbr(i=l;i<=n;i++){fdr(k=1;k<=n-i;k++)printff”);for(j=l;j<=i;j++)printfC#M);printff'n)#include“stdio.h”#definen10voidmain(){inti,k,j;inta[10][10];for(i=0;i<n;i-H-){fbr(k=l;k<=n-i;k-H-)printff”);for(j=0;j<=i;j++)prints"*");printf("\n");#include"stdio.h"#definen10voidmain(){inti,kj;inta[10][10];for(i=0;i<n;i++){for(k=i;k<n;k++)printf("");fbr(j=Oj<=ij++)printf("*");printf("\n");標ItIItt
ItHItM
0MMI!標
HItHMItIt
IIMIIMItItA
illtllllltltltll
llllllllllllllllll
Itltltltllllltllllll
llllllllllllllllllllll
llltltllllllllllllllltlt
llllllllllllllllllllllllll
llltllltltltllllllltlllllllt
Itllltlltllttlllllllllllllllll
Itllllllltllltllllllltllltlllllt
llltllllllllllllllllltllllllllllll
Itllllltllllllllllltltllllltllllllll
llltllllllllllllllllllltllltllllllllll
Itllllllllllllilltllllllllllllllltltllll
Itllllltllllllllllllltllltllllllllllllltll
llltllllllllilltllllllltllllllllllllltllllll
Itllltllltllltllltllllllllllllllllltllltllllll楊輝?角/*Note:YourchoiceisCIDE*/#includenstdio.hn#defineN100voidsetdate(int(*s)[N],intn){inti,j;fbr(i=0;i<n;i-H-){s[i][i]=l;s[i][0]=l;}fbr(i=2;i<n;i++)for(j=ly<iy-H-)s[i]U]=s[i-l]U-l]+s[i-l]U];)voidoutdate(ints[][N],intn){inti,j;printf("楊輝三角:\n");fbr(i=0;i〈n;i++){for(j=0;jv=i;j++)printf(n%5dH,s[i][j]);printfi(,,\nn);}main(){inta[N][N];intn;printff您希望輸出多少行呢?請輸入n=");scanfp%d”,&n);setdate(a,n);outdate(a,n);)魯左里難出多少行呢?請輸入na6物風二角: Is1112 113 3 11 4 6 4 11 5 10 10 5 11 6 15 20 15 6 11 7 21 35 35 21 7 11 8 28 56 70 56 28 8 11 9 36 84126126 84 36 9 11 10 45120210252210120 45 10 11 11 55165330462462330165 55 11 11 12 66220495792924792495220 66 12 11 13 782867151287171617161287715286 78 13 11 14 913641001200230033432300320021001364 91 14 11 1510545513653003500564356435500530031365455105 15 1#includenstdio.hn#definen10#include"stdlib.h”/?隨機調用函數(shù)的頭文件stdlib.h,n=rand()%x;n將得到ー個〇到x?l的隨機整數(shù)?/voidmain(){inta[n][n],b[n];doublec[n];inti,j;doubles;for(i=O;i<n;i-H-)for(j=0;j<n;j-H-)a[i][j]=rand()%100;printf(n轉換前:\nn);for(i=0;i<n;i++) for(j=O;j<nu++)printf(((j+l)%n=0)?n%4d\n',:n%4d,,,a[i]|j]);fbr(i=O;i<n;i-FF){s=0.0;fbr(j=O;jvn;j++)s+=a[i][j];b[i]=(int)(s);c[i]=s/n;}printf("轉換后:\n");fbr(i=O;i<n;i++)fbr(j=O;j<n;j++)printf(((j+1)%n=0)?"%4d這一行的和是%d平均值是%f\n":"%4d",a國[j],b國,c[i]);
91293766967312249600898165543171306682642461區(qū)玄立文區(qū)區(qū)玄文區(qū)區(qū)--8269541991293766967312249600898165543171306682642461區(qū)玄立文區(qū)區(qū)玄文區(qū)區(qū)--8269541911414217682ロロロロロロロロロ口
X戶JJ-KAKqJiJJJJK.JJ2J
一丁一丁一丁一丁一丁一丁一丁一丁一丁一丁7048971877
9175777367
4545344443
日否否否否否否否否否疋91757773674545344443
日者者否否否否否否否疋.700000.000000.400000.800000.900000.700000.100000.800000.700000.700000includenstdio.h#definen10#include"stdlib.h”/?隨機調用函數(shù)的頭文件stdlib.h,n=rand()%x;n將得到ー個〇到的隨機整數(shù)?/voidmain(){inta[n][n],b[n];intc[n];intij,max,min;for(i=0;i<n;i++)fbr(j=
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權益所有人同意不得將文件中的內容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
- 6. 下載文件中如有侵權或不適當內容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年度工業(yè)廠房交易全程服務合同4篇
- 2024音樂制作方與影視制作公司版權許可合同
- 二零二五年度交通樞紐害蟲防治與消毒作業(yè)合同3篇
- 專業(yè)水電安裝及消防系統(tǒng)承包合同2024年版版B版
- 2025年度12年首次智慧旅游項目合作協(xié)議3篇
- 2025年度叉車租賃合同范本(叉車租賃與維護)4篇
- 2025年度智慧城市基礎設施場地平整與物聯(lián)網(wǎng)協(xié)議4篇
- 2025年度奶牛養(yǎng)殖牛場租賃合同范本3篇
- 2025年廠房租賃合同風險評估與管理規(guī)范4篇
- 2024年04月廣西桂林銀行南寧分行社會招考筆試歷年參考題庫附帶答案詳解
- 聚焦任務的學習設計作業(yè)改革新視角
- 足球訓練基地管理制度
- 太平洋藍鯨計劃制度和基本法
- (承諾書)安防監(jiān)控售后服務承諾書范文
- 高低溫交變濕熱試驗檢測報告
- 蘇教版四年級數(shù)學下冊《全冊》完整課件ppt
- 《高一地理必修一全套課件》
- 新點軟件算量基礎知識內部培訓講義
- 幼兒園學前-《拍蚊子》教學課件設計
- 移動商務內容運營(吳洪貴)任務三 APP的品牌建立與價值提供
- 北師大版三年級數(shù)學上冊《總復習》教案及教學反思
評論
0/150
提交評論