摘要:
#includeint main(void){ int x,y; printf("Enter x,y:"); scanf("%d",&x); if(x<0){ y=-1; } if(x=0){ y=0; } else { y=1; } printf("%d\n",y); return 0;} 阅读全文
阅读排行榜
3-4
2013-10-20 08:38 by css1993, 123 阅读, 收藏,
摘要:
#includeint main(void){ int year; printf("Enter The year:"); scanf("%d",&year); while(year!=-1){ if((year%4==0&&year%100!=0)||(year%400==0)){ printf("The year is 闰年\n"); printf("Enter The year:"); scanf("%d",&year); } else{ printf(&qu 阅读全文
5-2
2013-10-27 11:37 by css1993, 121 阅读, 收藏,
摘要:
#includedouble fact(int x)int main(void){ int m,n; double y; printf("Enter m,n:"); scanf("%d%d\n",&m,&n); y=fact(m)/(fact(n)*fact(m-n)); printf("%lf\n",y); return=0;}double fact(int x){ int i; double y; y=1; for(i=1;i<=x;i++){ y=y*i; } return y;} 阅读全文
39-7
2013-10-20 12:44 by css1993, 121 阅读, 收藏,
摘要:
#include#includeint main(void){ int i,n; double power; printf("Enter n:"); scanf("%d",&n); for(i=1;i<=n;i++){ power=pow(2,i); printf("pow(2,%d)=%.0f\n",i,power); } return 0;} 阅读全文
作业五 指针的应用
2013-11-09 21:31 by css1993, 118 阅读, 收藏,
摘要:
#includevoid sum_diff(float op1,float op2,float*psum,float*pdiff){ *psum=op1+op2; *pdiff=op1-op2; return ;}int main(){ float op1,op2,psum,pdiff; printf("Enter op1,op2:\n"); scanf("%f%f",&op1,&op2); sum_diff(op1,op2,&psum,&pdiff); printf("*psum=%f,*pdiff=%f\n& 阅读全文
浙公网安备 33010602011771号