글
백준 8393번 합(JAVA, C#)
백준 프로그래밍
2023. 2. 14. 14:34
728x90
SMALL
자바
import java.util.*;
public class Main{
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int sum = a*(a+1)/2;
System.out.println(sum);
}
}
//////////////////////////
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);
}
}
}
}
728x90
'백준 프로그래밍' 카테고리의 다른 글
백준 15552번 빠른 A+B(Java, C#) (0) | 2023.02.14 |
---|---|
백준 25304번 영수증(JAVA, C#) (0) | 2023.02.14 |
백준 10950번 A+B-3(JAVA, C#) (0) | 2023.02.14 |
백준 2739번 구구단(JAVA, C#) (0) | 2023.02.14 |
백준 2480번 주사위 세 개(JAVA, C#) (0) | 2023.02.14 |