검색결과 리스트
백준 프로그래밍에 해당되는 글 53건
- 2023.02.14 백준 10950번 A+B-3(JAVA, C#)
- 2023.02.14 백준 2739번 구구단(JAVA, C#)
- 2023.02.14 백준 2480번 주사위 세 개(JAVA, C#)
- 2023.02.12 백준 2525번 오븐 시계(JAVA, C#)
- 2023.02.12 백준 2884번 알람 시계(JAVA, C#)
- 2023.02.12 백준 14681번 사분면(JAVA, C#)
- 2023.02.12 백준 2753번 윤년(JAVA, C#)
- 2023.02.12 백준 9498번 시험 성적(JAVA, C#)
글
백준 10950번 A+B-3(JAVA, C#)
자바
import java.util.*;
public class Main{
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int arr[] = new int[a];
for(int i = 1;i<=a;i++)
{
int b = sc.nextInt();
int c = sc.nextInt();
System.out.println(b + c);
}
sc.close();
}
}
///////////////////////////
C#
using System;
namespace Baekjoon {
class Program {
static void Main(string[] args) {
int t = int.Parse(Console.ReadLine()); // 개수 t
for (int i = 0; i < t; i++)
{
string[] s = Console.ReadLine().Split();
int b = int.Parse(s[0]);
int c = int.Parse(s[1]);
Console.WriteLine(b + c);
}
}
}
}
'백준 프로그래밍' 카테고리의 다른 글
백준 25304번 영수증(JAVA, C#) (0) | 2023.02.14 |
---|---|
백준 8393번 합(JAVA, C#) (0) | 2023.02.14 |
백준 2739번 구구단(JAVA, C#) (0) | 2023.02.14 |
백준 2480번 주사위 세 개(JAVA, C#) (0) | 2023.02.14 |
백준 2525번 오븐 시계(JAVA, C#) (0) | 2023.02.12 |
글
백준 2739번 구구단(JAVA, C#)
자바
import java.util.*;
public class Main{
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int mul = 0;
for(int i = 1;i<=9;i++)
{
mul = a*i;
System.out.println(a + " * " + i + " = " + mul);
}
}
}
///////////////////////
C#
using System;
namespace Baekjoon {
class Program {
static void Main(string[] args) {
string s = Console.ReadLine();
int a = int.Parse(s);
for(int i = 1;i<=9;i++)
{
int mul = a*i;
Console.WriteLine(a + " * " + i + " = " + mul);
}
}
}
}
'백준 프로그래밍' 카테고리의 다른 글
백준 8393번 합(JAVA, C#) (0) | 2023.02.14 |
---|---|
백준 10950번 A+B-3(JAVA, C#) (0) | 2023.02.14 |
백준 2480번 주사위 세 개(JAVA, C#) (0) | 2023.02.14 |
백준 2525번 오븐 시계(JAVA, C#) (0) | 2023.02.12 |
백준 2884번 알람 시계(JAVA, C#) (0) | 2023.02.12 |
글
백준 2480번 주사위 세 개(JAVA, C#)
자바
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);
}
}
}
}
}
'백준 프로그래밍' 카테고리의 다른 글
백준 10950번 A+B-3(JAVA, C#) (0) | 2023.02.14 |
---|---|
백준 2739번 구구단(JAVA, C#) (0) | 2023.02.14 |
백준 2525번 오븐 시계(JAVA, C#) (0) | 2023.02.12 |
백준 2884번 알람 시계(JAVA, C#) (0) | 2023.02.12 |
백준 14681번 사분면(JAVA, C#) (0) | 2023.02.12 |
글
백준 2525번 오븐 시계(JAVA, C#)
자바
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 min = 60 * a + b; // 시 -> 분
min += c;
int hour = (min / 60) % 24;
int minute = min % 60;
System.out.println(hour + " " + minute);
}
}
//////////////
C#
using System;
namespace Baekjoon {
class Program {
static void Main() {
string s = Console.ReadLine();
string[] s1 = s.Split();
int a = int.Parse(s1[0]);
int b = int.Parse(s1[1]);
string ss = Console.ReadLine();
int c = int.Parse(ss);
int min = 60 * a + b; // 시 -> 분
min += c;
int hour = (min / 60) % 24;
int minute = min % 60;
Console.WriteLine(hour + " " + minute);
}
}
}
'백준 프로그래밍' 카테고리의 다른 글
백준 2739번 구구단(JAVA, C#) (0) | 2023.02.14 |
---|---|
백준 2480번 주사위 세 개(JAVA, C#) (0) | 2023.02.14 |
백준 2884번 알람 시계(JAVA, C#) (0) | 2023.02.12 |
백준 14681번 사분면(JAVA, C#) (0) | 2023.02.12 |
백준 2753번 윤년(JAVA, C#) (0) | 2023.02.12 |
글
백준 2884번 알람 시계(JAVA, C#)
자바
import java.util.*;
public class Main{
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
int a, b;
a = sc.nextInt();
b = sc.nextInt();
if(b >= 45)
{
System.out.println(a + " " + (b-45));
}
else
{
if(a == 0)
{
System.out.println("23 " + (b+15));
}
else
{
System.out.println((a-1) + " " + (b+15));
}
}
}
}
/////////////
C#
using System;
namespace Baekjoon {
class Program {
static void Main() {
string s = Console.ReadLine();
string[] s1 = s.Split();
int a = int.Parse(s1[0]);
int b = int.Parse(s1[1]);
if(b >= 45)
{
Console.WriteLine(a + " " + (b-45));
}
else
{
if(a == 0)
{
Console.WriteLine("23 " + (b+15));
}
else
{
Console.WriteLine((a-1) + " " + (b+15));
}
}
}
}
}
'백준 프로그래밍' 카테고리의 다른 글
백준 2480번 주사위 세 개(JAVA, C#) (0) | 2023.02.14 |
---|---|
백준 2525번 오븐 시계(JAVA, C#) (0) | 2023.02.12 |
백준 14681번 사분면(JAVA, C#) (0) | 2023.02.12 |
백준 2753번 윤년(JAVA, C#) (0) | 2023.02.12 |
백준 9498번 시험 성적(JAVA, C#) (0) | 2023.02.12 |
글
백준 14681번 사분면(JAVA, C#)
자바
import java.util.*;
public class Main{
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
int a, b;
a = sc.nextInt();
b = sc.nextInt();
if(a > 0 && b > 0)
{
System.out.println("1");
}
else if(a > 0 && b < 0)
{
System.out.println("4");
}
else if(a < 0 && b > 0)
{
System.out.println("2");
}
else
{
System.out.println("3");
}
}
}
///////////////
C#
using System;
namespace Baekjoon {
class Program {
static void Main() {
string s = Console.ReadLine();
string s1 = Console.ReadLine();
int a = int.Parse(s);
int b = int.Parse(s1);
if(a > 0 && b > 0)
{
Console.WriteLine("1");
}
else if(a > 0 && b < 0)
{
Console.WriteLine("4");
}
else if(a < 0 && b > 0)
{
Console.WriteLine("2");
}
else
{
Console.WriteLine("3");
}
}
}
}
'백준 프로그래밍' 카테고리의 다른 글
백준 2525번 오븐 시계(JAVA, C#) (0) | 2023.02.12 |
---|---|
백준 2884번 알람 시계(JAVA, C#) (0) | 2023.02.12 |
백준 2753번 윤년(JAVA, C#) (0) | 2023.02.12 |
백준 9498번 시험 성적(JAVA, C#) (0) | 2023.02.12 |
백준 1330번 두 수 비교하기(C#, JAVA) (0) | 2023.02.12 |
글
백준 2753번 윤년(JAVA, C#)
JAVA
import java.util.*;
public class Main{
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
int a;
a = sc.nextInt();
if((a%4) == 0 && (a%100) != 0 || (a%400) == 0)
{
System.out.println("1");
}
else
{
System.out.println("0");
}
}
}
/////////////////////
C#
using System;
namespace Baekjoon {
class Program {
static void Main() {
string s = Console.ReadLine();
int a = int.Parse(s);
if((a%4) == 0 && (a%100) != 0 || (a%400) == 0)
{
Console.WriteLine("1");
}
else
{
Console.WriteLine("0");
}
}
}
}
'백준 프로그래밍' 카테고리의 다른 글
백준 2884번 알람 시계(JAVA, C#) (0) | 2023.02.12 |
---|---|
백준 14681번 사분면(JAVA, C#) (0) | 2023.02.12 |
백준 9498번 시험 성적(JAVA, C#) (0) | 2023.02.12 |
백준 1330번 두 수 비교하기(C#, JAVA) (0) | 2023.02.12 |
백준 25083번 새싹(C#, JAVA) (0) | 2023.02.12 |
글
백준 9498번 시험 성적(JAVA, C#)
자바
import java.util.*;
public class Main{
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
int a;
a = sc.nextInt();
if(a >= 90 && a <= 100)
{
System.out.println("A");
}
else if(a < 90 && a >= 80)
{
System.out.println("B");
}
else if(a < 80 && a >= 70)
{
System.out.println("C");
}
else if(a < 70 && a >= 60)
{
System.out.println("D");
}
else
{
System.out.println("F");
}
}
}
///////////////
C#
using System;
namespace Baekjoon {
class Program {
static void Main() {
string s = Console.ReadLine();
int a = int.Parse(s);
if(a >= 90 && a <= 100)
{
Console.WriteLine("A");
}
else if(a < 90 && a >= 80)
{
Console.WriteLine("B");
}
else if(a < 80 && a >= 70)
{
Console.WriteLine("C");
}
else if(a < 70 && a >= 60)
{
Console.WriteLine("D");
}
else
{
Console.WriteLine("F");
}
}
}
}
'백준 프로그래밍' 카테고리의 다른 글
백준 14681번 사분면(JAVA, C#) (0) | 2023.02.12 |
---|---|
백준 2753번 윤년(JAVA, C#) (0) | 2023.02.12 |
백준 1330번 두 수 비교하기(C#, JAVA) (0) | 2023.02.12 |
백준 25083번 새싹(C#, JAVA) (0) | 2023.02.12 |
백준 10172번 개(C#, JAVA) (0) | 2023.02.12 |