1 solutions

  • 0
    @ 2025-11-5 16:19:54

    C :

    # include <stdio.h>
    int main ()
    {
      int max ( int x, int y);
      int a, b, c;
      scanf("%d %d",&a,&b);
      c = max( a, b);
      printf("max=%d\n",c);
      return 0;
    }
    int max(int x, int y)
    {
      int z;
      if (x>y)
        z=x;
      else
        z=y;
      return(z);
    }
    

    C++ :

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

    Pascal :

    var
      a,b:longint;
    begin
      read(a,b);
      if a>b then writeln('max=',a)
    else writeln('max=',b);
    end.
    
    • 1

    Information

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