![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
习题
hsb1112
这个作者很懒,什么都没留下…
展开
-
求方程ax^2+bx+c=0的根(函数)
#include#includefloat x1,x2,disc,p,q;int main(){ void greater_than_zero(float,float); void equal_to_zero(float,float); void smaller_than_zero(float,float); float a,b,c;原创 2010-04-19 19:18:00 · 1026 阅读 · 0 评论 -
判断一个数是否为素数(函数)
#includeint main(){ int prime(int); int n; printf("/ninput an integer:"); scanf("%d",&n); if(prime(n)) { printf("/n %d is a prime./n",n); } el原创 2010-04-19 19:21:00 · 1121 阅读 · 0 评论 -
10的阶乘
#includeint main(){ int a=2,b=1; while(a<=10) { b=a*b; a++; } printf("10!=%d",b); int n; scanf("%d",&n);}原创 2010-04-19 19:26:00 · 479 阅读 · 0 评论 -
输出和逆序输出1个不多于5位的数
#include#includeint main(){ long int num; int indiv,ten,hundred,thousand,ten_thousand,place; printf("请输入一个整数(0-99999):"); scanf("%ld",&num); if (num>9999){ place=5原创 2010-04-19 19:36:00 · 407 阅读 · 0 评论 -
求最大公约数和最小公倍数(函数)
#includeint main(){ int hcf(int,int); int lcd(int,int,int); int u,v,h,l; scanf("%d,%d",&u,&v); h=hcf(u,v); printf("H.C.F=%d/n",h); l=lcd(u,v,h); printf("L.C原创 2010-04-19 19:16:00 · 1245 阅读 · 0 评论 -
密码(China到Glmre)
#includeint main(){ char c1=C,c2=h,c3=i,c4=n,c5=a; c1+=4; c2+=4; c3+=4; c4+=4; c5+=4; printf("密码是%c%c%c%c%c/n",c1,c2,c3,c4,c5); int n; scanf(原创 2010-04-19 19:30:00 · 1644 阅读 · 0 评论