fork(1) download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. // your code goes here
  5. #include <stdio.h>
  6. int main(void) {
  7. int x,y,z,m,t;
  8. printf("\n请输入四个数字:\n");
  9. scanf("%d%d%d%d",&x,&y,&z,&m); // 这里改了
  10.  
  11. if ( x>y ) {
  12. t=x; x=y; y=t;
  13. }
  14.  
  15. if ( x>z ) {
  16. t=x; x=z; z=t;
  17. }
  18.  
  19. if (x>m) { // 加大括号
  20. t=x;x=m;m=t;
  21. }
  22.  
  23. if ( y>z ) {
  24. t=y; y=z; z=t;
  25. }
  26.  
  27. if (y>m) { // 加大括号
  28. t=y;y=m;m=t;
  29. }
  30.  
  31. if (z>m) { // 加大括号
  32. t=z;z=m;m=t;
  33. }
  34.  
  35. printf("从小到大排序 %d %d %d %d\n",x,y,z,m);
  36. return 0;
  37. }return 0;
  38. }
  39.  
Success #stdin #stdout 0.01s 5300KB
stdin
Standard input is empty
stdout
Standard output is empty