1、 p1=p*(1+r5)*5); #include float d=300000,p=6000,r=,m; m=log10(p/(p-d*r)/log10(1+r);m=%n,m);3-4int c1,c2; c1=197; c2=198;c1=%c,c2=%cn,c1,c2);c1=%d,c2=%dn3-5int a,b; float x,y; char c1,c2;a=%d b=%db);%f %ex,&y);%c%cc1,&c2);a=%d,b=%d,x=%f,y=%f,c1=%c,c2=%cn,a,b,x,y,c1,c2);3-6char c1=C,c2=h,c3=i,c4=n,c5=
2、a; c1=c1+4; c2=c2+4; c3=c3+4; c4=c4+4; c5=c5+4;passwor is %c%c%c%c%cn,c1,c2,c3,c4,c5);3-7int main ()float h,r,l,s,sq,vq,vz; float pi=;请输入圆半径r,圆柱高h%f,%fr,&h); int x,y;输入x:%dx); if(x1) /* x1 */ y=x;x=%3d, y=x=%dn ,x,y); else if(x10) /* 1=x=10 */ y=3*x-11;x=%d, y=3*x-11=%dn4-7-1 int x,y;enter x: y=-1;
3、if(x!=0) if(x0) y=1; else y=0;x=%d,y=%dn4-7-2please enter x:0) y=1; else y=-1;4-8 float score; char grade;请输入学生成绩:%fscore); while (score100|score printf(n 输入有误,请重输 switch(int)(score/10) case 10: case 9: grade=Abreak; case 8:B case 7: case 6:D case 5: case 4: case 3: case 2: case 1: case 0:E成绩是 %,相应的
4、等级是%cn ,score,grade);4-9 int num,indiv,ten,hundred,thousand,ten_thousand,place; .=%dn,sn);5-6 double s=0,t=1; int n; for (n=1;n=20;n+) t=t*n; s=s+t;1!+2!+.+20!=%n,s);5-7 int n1=100,n2=50,n3=10; double k,s1=0,s2=0,s3=0; for (k=1;k=n1;k+) /*计算1到100的和*/ s1=s1+k;=n2;k+) /*计算1到50各数的平方和*/ s2=s2+k*k;=n3;k+
5、) /*计算1到10的各倒数和*/ s3=s3+1/k;sum=%n,s1+s2+s3);5-8 int i,j,k,n;parcissus numbers are for (n=100;1000; i=n/100; j=n/10-i*10; k=n%10; if (n=i*i*i + j*j*j + k*k*k)%d ,n);5-9-1#define M 1000 /*定义寻找范围*/ int k1,k2,k3,k4,k5,k6,k7,k8,k9,k10; int i,a,n,s; for (a=2;a=M;a+) /* a是2-1000之间的整数,检查它是否完数 */ n=0; /* n用
6、来累计a的因子的个数 */ s=a; /* s用来存放尚未求出的因子之和,开始时等于a */ for (i=1;i1) printf(%d,%d,k1,k2); /* n1表示a至少有2个因子 */2) printf(,%d,k3);2表示至少有3个因子,故应再输出一个因子 */ 3) printf(,k4);3表示至少有4个因子,故应再输出一个因子 */4) printf(,k5); /* 以下类似 */5) printf(,k6);6) printf(,k7);7) printf(,k8);8) printf(,k9);9) printf(,k10);5-9-2 int m,s,i; fo
7、r (m=2;m x1=(x2+1)*2; /*第1天的桃子数是第2天桃子数加1后的2倍.*/ x2=x1; day-;total=%dn,x1);5-13 float a,x0,x1;enter a positive number:a); x0=a/2; x1=(x0+a/x0)/2; do x0=x1; while(fabs(x0-x1)=1e-5);The square root of % is %n,a,x1);5-14 double x1,x0,f,f1; x1=; f=(2*x0-4)*x0+3)*x0-6; f1=(6*x0-8)*x0+3; x1=x0-f/f1; while(
8、fabs(x1-x0)The root of equation is %n5-15 float x0,x1,x2,fx0,fx1,fx2;enter x1 & x2:x1,&x2); fx1=x1*(2*x1-4)*x1+3)-6; fx2=x2*(2*x2-4)*x2+3)-6; while(fx1*fx20); x0=(x1+x2)/2; fx0=x0*(2*x0-4)*x0+3)-6; if (fx0*fx1)x=%n,x0);5-16 int i,j,k; for (i=0;=3; for (j=0;jaj) min=j; temp=ai; ai=amin; amin=temp;nTh
9、e sorted numbers:6-3int a33,sum=0;int i,j;3; for (j=0;%3daij); sum=sum+aii;sum=%6dn,sum);6-4 int a11=1,4,6,9,13,16,19,28,40,100; int temp1,temp2,number,end,i,j;array a:10;insert data:number); end=a9; if (numberend) a10=number; for (i=0; if (ainumber) temp1=ai; ai=number;11; temp2=aj; aj=temp1; temp1
10、=temp2;Now array a:6-5#define N 5 int aN,i,temp;enter array a:N;%4dN/2;i+) n,number);continu or not(Y/N)? %c if (c=N|c= flag=0;6-10 int i,j,upp,low,dig,spa,oth; char text380; upp=low=dig=spa=oth=0; printf(please input line %d:,i+1); gets(texti);80 & textij!0 if (textij textij low+;09 dig+; else if (textij= spa+; oth+;nupper case: %dn,upp);lower case:,low);digit :,dig);space :,spa);other :,oth);6-11 char a5=*,; int i,
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1