1 solutions

  • 0
    @ 2025-11-5 15:29:53

    C :

    #include<stdio.h>
    int main()
    {
    	int a,b,c,t;
    	scanf("%d%d%d",&a,&b,&c);
    	if(a<c)
    	{
    		t=a;a=c;c=t;
    	}
    	if(a<b)
    	{
    		t=a;a=b;b=t;
    	}
    	printf("%d\n",a);
    }
    
    

    C++ :

    #include<iostream>
    using namespace std;
    int main()
    {
    	int a, b, c;
    	cin >> a >> b >> c;
    	if (a >= b&&a >= c)
    		cout << a << endl;
    	else if (b >= a&&b >= c)
    		cout << b << endl;
    	else
    		cout << c << endl;
    	return 0;
    }
    
    • 1

    C语言程序设计教程(第三版)课后习题1.6

    Information

    ID
    16856
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    (None)
    Tags
    (None)
    # Submissions
    0
    Accepted
    0
    Uploaded By