2 条题解

  • 0
    @ 2023-11-4 14:51:31
    #include<bits/stdc++.h>
    using namespace std;
    int a,b,c,d;
    int qtt,kegou,zhaol;
    int main(){
    	cin>>a>>b>>c>>d;
    	if(a>=b&&a<=c||a<=b&&a>=c) qtt=a;
    	else if(b>=a&&b<=c||b<=a&&b>=c) qtt=b;
    	else if(c>=a&&c<=b||c<=a&&c>=b) qtt=c;
    	kegou=10/qtt;
    	zhaol=10%qtt;
    	cout<<kegou<<" "<<zhaol;
    }
    
    • @ 2023-11-4 14:52:00

      样例没错但提交就错了

    • @ 2023-11-4 14:56:57
      #include<bits/stdc++.h>
      using namespace std;
      int a,b,c,d;
      int qtt,kegou,zhaol;
      int main(){
      	cin>>a>>b>>c>>d;
      	if(b>=c&&b<=d||b<=c&&b>=d) qtt=b;
      	else if(c>=b&&c<=d||c<=b&&c>=d) qtt=c;
      	else if(d>=b&&d<=c||d<=b&&d>=c) qtt=d;
      	kegou=a/qtt;
      	zhaol=a%qtt;
      	cout<<kegou<<" "<<zhaol;
      }
      

      #等等做错了

  • 0
    @ 2022-11-5 14:07:09
    #include<bits/stdc++.h>
    using namespace std;
    int fun(int x,int y,int z)
    {
    	int f=max(max(x,y),max(y,z));
    	int m=min(min(z,y),min(x,y));
    	if(x!=f&&x!=m)return x; 
    	else if(y!=f&&y!=m) return y;
    	else return z; 
    }
    int main()
    {
    	int a,b,c,q;
    	cin>>q>>a>>b>>c;
    	int f=fun(a,b,c);
    	cout<<q/f<<" "<<q%f;
     }
    
    
    
    
    • 1

    信息

    ID
    462
    时间
    1000ms
    内存
    32MiB
    难度
    5
    标签
    递交数
    229
    已通过
    84
    上传者