Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

기본 알고리즘 io 추가 문항 #6

Merged
merged 1 commit into from
Jul 22, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions io/Code_10818.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package io;

import java.util.Scanner;

/*
* �ۼ��� : 2018�� 07�� 20��
* �� �� : �ּ�, �ִ�
* N���� ������ �־�����. �� ��, �ּڰ��� �ִ��� ���ϴ� ���α׷��� �ۼ�.
*/
public class Code_10818 {

public static void main(String[] args) {
// TODO Auto-generated method stub

Scanner sc = new Scanner(System.in);

int num = sc.nextInt();
sc.nextLine();
String[] s = sc.nextLine().split(" ");
int max = Integer.MIN_VALUE;
int min = Integer.MAX_VALUE;

for(int i=0; i<s.length; ++i) {
int x = Integer.parseInt(s[i]);
if(x>max) {
max = x;
}
if(x<min) {
min = x;
}
}
System.out.println(min+" "+max);
}
}
26 changes: 26 additions & 0 deletions io/Code_1924.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package io;


import java.io.IOException;
import java.util.Scanner;

/*
* �ۼ��� : 2018�� 07�� 20��
* �� �� : 2007��
* ������ 2007�� 1�� 1�� �������̴�. �׷��ٸ� 2007�� x�� y���� ���� �����ϱ�? �̸� �˾Ƴ��� ���α׷��� �ۼ�.
* */
public class Code_1924 {

public static void main(String[] args) throws NumberFormatException, IOException {
// TODO Auto-generated method stub

Scanner input = new Scanner(System.in);

int num = input.nextInt();

for(int i=1; i<10; ++i) {
System.out.println(num+" * "+i+" = "+num*i);
}
}

}
21 changes: 21 additions & 0 deletions io/Code_2438.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package io;

import java.util.Scanner;

/*
* �ۼ��� : 2018�� 07�� 20��
* �� �� : ����� - 1
* ù° �ٺ��� N��° �� ���� ���ʴ�� ���� ���.
*/
public class Code_2438 {

public static void main(String[] args) {
// TODO Auto-generated method stub

Scanner sc = new Scanner(System.in);

int num = sc.nextInt();


}
}
26 changes: 26 additions & 0 deletions io/Code_2739.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package io;


import java.io.IOException;
import java.util.Scanner;

/*
* �ۼ��� : 2018�� 07�� 20��
* �� �� : ������
* N�� �Է¹��� ��, ������ N���� ����ϴ� ���α׷��� �ۼ�.
*/
public class Code_2739 {

public static void main(String[] args) throws NumberFormatException, IOException {
// TODO Auto-generated method stub

Scanner input = new Scanner(System.in);

int num = input.nextInt();

for(int i=1; i<10; ++i) {
System.out.println(num+" * "+i+" = "+num*i);
}
}

}
25 changes: 25 additions & 0 deletions io/Code_2742.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package io;


import java.io.IOException;
import java.util.Scanner;

/*
* �ۼ��� : 2018�� 07�� 20��
* �� �� : ��� N
* �ڿ��� N�� �־����� ��, N���� 1���� �� �ٿ� �ϳ��� ����ϴ� ���α׷��� �ۼ��Ͻÿ�.
*/
public class Code_2742 {

public static void main(String[] args) throws NumberFormatException, IOException {
// TODO Auto-generated method stub

Scanner input = new Scanner(System.in);

int num = input.nextInt();
num+=1;
while(num-->1)
System.out.println(num);
}

}
23 changes: 23 additions & 0 deletions io/Code_8393.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package io;


import java.io.IOException;
import java.util.Scanner;

/*
* �ۼ��� : 2018�� 07�� 20��
* �� �� : sum
* 1~n������ ���� ����Ѵ�.
* */
public class Code_8393 {

public static void main(String[] args) throws NumberFormatException, IOException {
// TODO Auto-generated method stub

Scanner input = new Scanner(System.in);

int num = input.nextInt();
System.out.println((num*(num+1))/2);
}

}