b&c官网
@印凝533:python并列条件判断怎么写例如ifa>b&c -
徒晨19534556373…… $ python Python 2.7.3 (default, Mar 14 2014, 11:57:14) [GCC 4.7.2] on linux2 Type "help", "copyright", "credits" or "license" for more information.>>> a = 1>>> b = 2>>> c = 2>>> d = 4>>> if a < b == c < d:... print "OK"... OK>>>
@印凝533:c语言判断三个数大小
徒晨19534556373…… 首先,穿进去的是指针,你现在这样写是在比较地址的大小,没有意义,同楼上所说加a,b,c前加*; 然后,你的交换逻辑也有问题 void fun(int *a,int *b,int *c) { int k; if(*a<*b) {k=*a;*a=*b;*b=k;} if(*a<*c) {k=*a;*a=*c;*c=k;} if(*b<*c) {k=*b;*b=*c;*c=k;} } 应该是这样写,我调试过了,就是这样
@印凝533:C?????η??”ǎ
徒晨19534556373…… #include "stdio.h" #include "math.h" main() { float a,b,c,p,x1,x2,realpart,imagepart; scanf("%f%f%f",&a,&b,&c); if(a==0&&b==0) printf("unsolvble\n"); else if(a==0&&b!=0) printf("the single root is %f",-c...
徒晨19534556373…… $ python Python 2.7.3 (default, Mar 14 2014, 11:57:14) [GCC 4.7.2] on linux2 Type "help", "copyright", "credits" or "license" for more information.>>> a = 1>>> b = 2>>> c = 2>>> d = 4>>> if a < b == c < d:... print "OK"... OK>>>
@印凝533:c语言判断三个数大小
徒晨19534556373…… 首先,穿进去的是指针,你现在这样写是在比较地址的大小,没有意义,同楼上所说加a,b,c前加*; 然后,你的交换逻辑也有问题 void fun(int *a,int *b,int *c) { int k; if(*a<*b) {k=*a;*a=*b;*b=k;} if(*a<*c) {k=*a;*a=*c;*c=k;} if(*b<*c) {k=*b;*b=*c;*c=k;} } 应该是这样写,我调试过了,就是这样
@印凝533:C?????η??”ǎ
徒晨19534556373…… #include "stdio.h" #include "math.h" main() { float a,b,c,p,x1,x2,realpart,imagepart; scanf("%f%f%f",&a,&b,&c); if(a==0&&b==0) printf("unsolvble\n"); else if(a==0&&b!=0) printf("the single root is %f",-c...