728x90
SMALL

자바

 

 

import java.util.*;

 

public class Main{
public static void main(String args[]){
  Scanner sc = new Scanner(System.in);

 

int a, b, c;
  a = sc.nextInt();
  b = sc.nextInt();
  c = sc.nextInt();
    int prize = 0;

 

  if(a == b && b == c)
    {
        System.out.print(10000+(a*1000));
    }

    else if(a == b || a == c)
    {
         System.out.print(1000+(a*100));
    }
    else if(b == c)
    {
        System.out.print(1000+(b*100));
    }

    else
    {

          System.out.print((Math.max(a, Math.max(b, c))*100));

    }

}

}

 

 

 

///////////////

 

 

C#

 

 

 

using System;
using System.Collections.Generic;
using System.Linq;

namespace Baekjoon {
    class Program {
        static void Main(string[] args) {
            string s = Console.ReadLine();
            string[] s1 = s.Split();
            int a = int.Parse(s1[0]);
            int b = int.Parse(s1[1]);
            int c = int.Parse(s1[2]);
            
    if(a == b && b == c)
    {
        Console.WriteLine(10000+(a*1000));
    }
    else if(a == b || a == c)
    {
         Console.WriteLine(1000+(a*100));
    }
    else if(b == c)
    {
        Console.WriteLine(1000+(b*100));
    }
    else
    {
         if (a > b && a > c)
        {
            Console.WriteLine(100 * a);
        }
        else if(b > c)
        {
             Console.WriteLine(100 * b);
        }
        else
        {
             Console.WriteLine(100 * c);
        }
  }
        }
    }
}

 

728x90

설정

트랙백

댓글