/*import java.util.*;
public class Main{
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int arr[][] = new int[100][100];
for(int k=1;k<=4;k++)
{
int x1 = in.nextInt();
int y1 = in.nextInt();
int x2 = in.nextInt();
int y2 = in.nextInt();
for(int i=x1;i<x2;i++) {
for(int j=y1;j<y2;j++) {
arr[i][j]=1;
}
}
}
int sum=0;
for(int i=0;i<100;i++) {
for(int j=0;j<100;j++) {
sum=sum+arr[i][j];
}
}
System.out.println(sum);
}
}
import java.util.*;
public class Main{
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int i,max=0,mi=1;
for(i=1;i<=9;i++) {
int k;
k=in.nextInt();
if(max<k) {
max=k;
mi=i;
}
}
System.out.println(max);
System.out.println(mi);
}
}
import java.util.*;
public class Main{
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int i,n,sum=0;
int t=1;
n=in.nextInt();
for(i=1;i<=n;i++) {
int k=in.nextInt();
if(k==1){
sum+=t; //t : 연속으로 맞은 갯수
t++;
}
else {
t=1;
}
}
System.out.println(sum);
}
}
import java.util.*;
public class Main{
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int h,r;
h=in.nextInt();
r=in.nextInt();
for(int k=1;k<=r;k++) {
for(int i=1;i<=h;i++)
{
for(int j=1;j<=i-1;j++) {
System.out.print(" ");
}
System.out.println("*");
}
for(int i=h-1;i>=1;i--) {
for(int j=1;j<=i-1;j++) {
System.out.print(" ");
}
System.out.println("*");
}
}
}
}
import java.util.*;
public class Main{
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int h;
h=in.nextInt();
for(int i=1;i<=h;i++)
{
for(int j=1;j<=i;j++) {
System.out.print("*");
}
System.out.println();
}
for(int i=h-1;i>=1;i--) {
for(int j=1;j<=i;j++) {
System.out.print("*");
}
System.out.println();
}
}
}
#include<stdio.h>
int main()
{
int i,j,n;
scanf("%d",&n);
for(i=n-1;i>=0;i--)
{
for(j=1;j<=i;j++)
{
printf(" ");
}
for(j=1;j<=n;j++)
{
printf("*");
}
printf("\n");
}
return 0;
}
import java.util.*;
public class Main{
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int i,j;
int h=in.nextInt();
int k=in.nextInt();
char d=in.next().charAt(0);
for(i=1;i<=h;i++) {
if(d=='L'){
for(j=1;j<=i-1;j++) {
System.out.print(" ");
}
}
else {
for(j=1;j<=h-i;j++) {
System.out.print(" ");
}
}
for(j=1;j<=k;j++) {
System.out.print("*");
}
System.out.println();
}
내용물
}
}*/
/*
import java.util.*;
class Bung{
int size; //크기
String con; // 내용물
String shape; //모양
}
public class Main{
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
Bung a = new Bung(); //a객체 생성
a.con="cream"; // a의 필드 설정
System.out.println(a.con);
Bung b = new Bung();
b.con = "red bean";
System.out.println(b.con);
}
}
import java.util.*;
class Person{
String name;
String job;
int age;
void speak() //메소드 (함수)
{
System.out.println("안녕하세요 저는 "+name+"입니다.");
}
void setName(String newName)
{
name=newName;
}
}
public class Main{
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
Person a = new Person();
a.name="patrick"; //1번방법
a.speak();
a.setName("doyun"); //2번방법 (추천)
a.speak();
a.job="student";
a.age = 80;
Person b = new Person();
b.name = "chloe";
b.job = "teacher";
b.age = 1000;
a.speak();
b.speak();
}
}
*/