7 条题解

  • 0
    @ 2025-10-3 17:03:19
    #include<stdio.h>
    int main()
    {
        int a[3];
        for(int i=0;i<3;i++)
        {
            scanf("%d",&a[i]);
        }
        int tem=0;
        for(int i=0;i<2;i++)
        {
           for(int j=i;j<2;j++)
           {
            if(a[j]>a[j+1]){
                tem=a[j];
                a[j]=a[j+1];
                a[j+1]=tem;
            }
           }
        }
        for(int i=0;i<3;i++)
        {
            printf("%d ",a[i]);
        }
        return 0;
    }
        
    
    • 0
      @ 2025-10-1 0:04:06
      #include <stdio.h>
      int main()
      {
          int a,b,c,max,min,middle;
          scanf("%d %d %d",&a,&b,&c);
          max=a;min=a;middle=a;
          if (b>max)max=b;
          else if(min>b)min=b;
          if (c>max)max=c;
          else if(min>c)min=c;
          if(middle==max) middle=b;
          if(middle==min) middle=c;
          printf("%d %d %d",min,middle,max);
      }
      
      • 0
        @ 2025-1-3 20:12:59
        #include<stdio.h>
        #include<iostream>	
        #include<algorithm>
        using namespace std; 	
        int main()	
        {
        	int f[3];
        	for(int i=0;i<3;i++)
        	{
        		cin>>f[i];
        	}
        	sort(f,f+4);
        	cout<<f[1]<<" ";
        	cout<<f[2]<<" ";
        	cout<<f[3]<<" ";
        	return 0;
        }sort```无脑
        
        • 0
          @ 2023-9-24 15:06:02
          #include<stdio.h> 
          int main()
           { int x,y,z,t;
           scanf("%d %d %d",&x,&y,&z);
           if(x>y)
          { t=x; x=y; y=t; 
          }if(x>z)
          { t=x; x=z; z=t; 
          }
          if(y>z)
          { t=y; y=z; z=t; 
          } 
          printf("%d %d %d",x,y,z); 
          return 0;
           }
          
          • 0
            @ 2023-9-23 19:05:37

            #include<stdio.h> int main() { int x,y,z,t; scanf("%d %d %d",&x,&y,&z); if(x>y){ t=x; x=y; y=t; }if(x>z){ t=x; x=z; z=t; }if(y>z){ t=y; y=z; z=t; } printf("%d %d %d",x,y,z); return 0; }

            • 0
              @ 2023-7-28 2:24:32

              这道题用点小心思会做得没意义,还是自己练练的好

              #include<iostream>
              #include<algorithm>
              using namespace std;
              int arr[2];
              int main() {
                  cin >> arr[0] >> arr[1] >> arr[2];
                  sort(arr, arr + 3);
                  cout << arr[0] << " " << arr[1] << " " << arr[2];
              }
              
              • 0
                @ 2022-11-26 12:43:33

                #include<iostream> #include<algorithm> using namespace std;

                int main(){ int a[3]; for(int i=0;i<3;i++){ cin>>a[i]; } sort(a,a+3); for(int i=0;i<3;i++){ cout<<a[i]<<" "; } }

                • 1

                信息

                ID
                135
                时间
                3000ms
                内存
                128MiB
                难度
                4
                标签
                (无)
                递交数
                925
                已通过
                462
                上传者