概1 #include<stdio.h>int main(){ int m = 23, n = 5; printf("%d\n",!m + m % n); return 0;}
概6 #include<stdio.h>int main(){ int x = 1, y = 2; (x > y) && (–x > 0); printf("%d\n",x); return 0;}
概15代码 #include<stdio.h>int main(){ int a = 0, b = 3, c = 2; if (a++ && b++) { c–; } else if (a + 1 == 6 || b–) { c++; } printf("%d,%d,%d\n", a, b, c); return 0;}
概16代码 #include<stdio.h>#include<math.h>int main(){ int a=2 , b=2 ,c=4; if (sqrt(fabs(a)) != (4 * a) / (b * c)) { a = 2; } else { printf(“不构成”); } printf("%d\n", a); return 0;}
概17 #include<stdio.h>int main(){ int a = 0, b = 0, c = 0; if(a++&&(b+=a)||++c) printf("%d,%d,%d\n",a,b,c); return 0;}
选择题8 #include<stdio.h>int main(){ int a, b, x, y; x = 3, y = 5; if (x > y) { a = x; b = y; } else { a = y; b = x; } printf("%d,%d\n", a, b); return 0;}
选择题10 #include<stdio.h>int main(){ int a , b , c ; a = 3; b = 3; c = 2; printf("%d,\n",!a&&!b&&c); return 0;}
选择题17 #include<stdio.h>int main(){ int n; n = 8; n %= (n - 2); printf("%d\n",n); return 0;}
选择题18 #include<stdio.h>int main(){ int a = 3, b = 2,x; x = a > b++?a++:b++; printf("%d,%d,%d\n",x,a,b); return 0;}
选择题20 #include<stdio.h>int main(){ int x, y, z; x = 4; y = 3; z = 5; if (x > y) { z = x; x = y; y = z; } printf("%d,%d,%d\n",x,y,z); return 0;} 选择题24#include<stdio.h>int main(){ int a = 0, b = 2; b = --a || ++b; printf("%d\n",b); return 0;}选择题25#include<stdio.h>int main(){ int s, x; x = 5; s = x <= 0 ? -1 : (x == 0) ? 0 : 1; printf(“s=%d\n”,s); return 0;}阅读1#include<stdio.h>int main(){ int x = 0, y = 1, z = 10; if (x) { if (y) { z = 20; } else { z = 30; } } printf("%d\n",z); return 0;}阅读3#include<stdio.h>int main(){ int x = 0, y =0, z =0 ; if (x++ && (y += x) || ++z); printf("%d,%d,%d\n",x,y,z); return 0;选择题20
#include<stdio.h> int main() { int x, y, z; x = 4; y = 3; z = 5; if (x > y) { z = x; x = y; y = z; } printf("%d,%d,%d\n",x,y,z); return 0; }
选择题24
#include<stdio.h> int main() { int a = 0, b = 2; b = --a || ++b; printf("%d\n",b); return 0; }
选择题25
#include<stdio.h> int main() { int s, x; x = 5; s = x <= 0 ? -1 : (x == 0) ? 0 : 1; printf(“s=%d\n”,s); return 0;
阅读1 #include<stdio.h>int main(){ int x = 0, y = 1, z = 10; if (x) { if (y) { z = 20; } else { z = 30; } } printf("%d\n",z); return 0;}
阅读3 #include<stdio.h>int main(){ int x = 0, y =0, z =0 ; if (x++ && (y += x) || ++z); printf("%d,%d,%d\n",x,y,z); return 0;}
编程1 #include<stdio.h>int main(){ int x ; scanf_s(“请输入一个整数:”, & x); if (x % 2 == 0){ printf(“x是奇数\n”, x); } else { printf(“x是奇数\n”, x); } return 0;}
编程2 #include<stdio.h>#include<math.h>int main(){ double a, b, c, x1, x2; printf(“请输入三个系数:”); scanf_s(“a=%lf,b=%lf,c=%lf”, &a, &b, &c); double s = (b * b) - (4 * a * c); if (a == 0) { printf(“该方程不是一元二次方程\n”); } else { printf(“该方程是一元二次方程”); if (s == 0) { printf(“只有一个解:x1=%lf,x2=%lf\n”, x1 = -b / (2 * a), x2 = -b / (2 * a)); } if (s > 0) { printf(“有两个解:x1=%lf,x2=%lf”, x1 = (-b + sqrt(s)) / (2 * a), x2 = (-b - sqrt(s)) / (2 * a)); } } return 0;}
  
                            
|