资源描述:
《C20111225大题题目》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、#includevoidmain(){longf=/**//**/;inti;for(i=1;i<=13;/**//**/)f=f*i;printf("f=%ld",f);getch();}#includevoidmain(){intp,q,r;floatf;clrscr();printf("Pleaseinputpq:");scanf("%d%d",/**//**/);f=1.0*p/q;r=(int)/**//**/%10;printf("p/q=%fThefirstdecimalplaceis:%
2、d",f,r);getch();}#include#includedoublef(double/**//**/){return(x*x*x+1.3*x*x+1.1*x-1.2);}voidmain(){floatx,x1,x2;doubley,y1,y2;do{printf("Inputx1,x2:");scanf("%f,%f",&x1,&x2);y1=f(x1);y2=f(x2);}while(y1*y2>=0);do{x=(x1+x2)/2;y=/**//**/(x);y1=f(x1);if(y*y1>
3、0)x1=x;elsex2=/**//**/;}while(fabs(y)>=1e-6);printf("RootofEquationis%8.3f",x);getch();}#include#includevoidmain(){chars[20];inti;printf("Pleaseinputastring:");scanf(/**//**/,s);i=0;while(s[i]){s[i]=/**//**//**//**/}printf("Targetstring:%s",s);getch();
4、}#includevoidmain(){inti,n;/**//**/;for(i=1;i<=/**//**/;i++){if((i%3==0
5、
6、i%7==0)&&(i%/**//**/==3)){printf("%5d",i);n++;if(n%6==0)printf("");}}getch();}#include#includevoidsort(inta[],intn){inti,j,k,temp;for(i=0;i7、f(/**//**/)k=j;if(k!=i){temp=/**//**/;a[k]=a[i];a[i]=temp;}}}voidmain(){inta[]={50,25,88,32,2,65,7,64};inti,n=sizeof(a)/sizeof(int);sort(a,n);for(i=0;i#include/**//**/doublef(doublex){doubley;y=/**//**/;return(y)
8、;}voidmain(){doublex,y1,y2;printf("Pleaseinputx:");scanf("%lf",&x);y1=f(/**//**/);y2=f(sin(x));printf("f(x+1.1)=%.3lf",y1);printf("f(sinx)=%.3lf",y2);getch();}#include#includeintcount(/**//**/){intn=0;char*p=/**//**/;while(*p){if(*p=='a')n++;/**//**/;}
9、returnn;}voidmain(){chars[255];printf("Enterastring:");gets(s);printf("Countofais:%d",count(s));getch();}#include"stdio.h"#defineROW3#defineCOL4voidmain(){inta[ROW][COL]={2,11,3,5,7,24,8,9,16,10,18,66};intb[ROW][COL]={1,9,5,12,6,11,13,2,15,7,25,56};intc[/**//**/][COL],i,j;f
10、or(i=0;i