top of page

게시판 게시물

dlatjdus222
2022년 6월 14일
In 소스 코드 제출
#include <stdio.h> #include <stdlib.h> /* int main() { int a[101][101]={}; int b, c=1; int i,j=1; scanf("%d",&b); for(i=1;i<=b;i++) { for(j=1;j<=b;j++) { a[i][j]=c++; } } for(i=1;i<=b;i++) { for(j=1;j<=b;j++) { printf("%d ",a[i][j]); } printf("\n"); } return 0; } */ /* int main() { int a[101][101]={}; int b; int i,j,c=1; scanf("%d",&b); for (i=1;i<=b;i++) { for(j=b;j>=1;j--) { a[i][j]=c++; } } for (i=1;i<=b;i++) { for(j=1;j<=b;j++) { printf("%d ",a[i][j]); } printf("\n"); } return 0; } */ /* int main() { int a[101][101]={}; int b; int i,j,c=1; scanf("%d",&b); for(i=1;i<=b;i++) { for(j=1;j<=b;j++) { a[j][i]=c++; } } for (i=1;i<=b;i++) { for(j=1;j<=b;j++) { printf("%d ",a[i][j]); } printf("\n"); } return 0; } */ /* int main() { int a[101][101]={}; int b; int i,j,c=1; scanf("%d",&b); for(i=1;i<=b;i++) { for(j=b;j>=1;j--) { a[j][i]=c++; } } for (i=1;i<=b;i++) { for(j=1;j<=b;j++) { printf("%d ",a[i][j]); } printf("\n"); } return 0; } */ /* int main() { int a[101][101]={}; int b,c; int i,j,d=1; scanf("%d %d",&b,&c); for(i=1;i<=b;i++) { for(j=c;j>=1;j--) { a[i][j]=d++; } } for (i=b;i>=1;i--) { for(j=1;j<=c;j++) { printf("%d ",a[i][j]); } printf("\n"); } return 0; } */ /* int main() { int a[101][101]={}; int b,c; int i,j,d=1; scanf("%d %d",&b,&c); for(i=1;i<=b;i++) { for(j=1;j<=c;j++) { a[i][j]=d++; } } for (i=b;i>=1;i--) { for(j=1;j<=c;j++) { printf("%d ",a[i][j]); } printf("\n"); } return 0; } */ int main() { int a[101][101]={}; int b,c; int i,j,d=1; scanf("%d %d",&b,&c); for(i=1;i<=b;i++) { for(j=c;j<=c;j++) { a[i][j]=d++; } } //i=b;i>=1;i-- i=1;i<=b;i++ for (i=b;i>=1;i--) { for(j=1;j<=c;j++) { printf("%d ",a[i][j]); } printf("\n"); } return 0; }
0
0
1
dlatjdus222
2022년 5월 24일
In 소스 코드 제출
#include <stdio.h> #include <string.h> /* int main() { char a[21]={}; char b[21]={}; char c[21]={}; int i,j,k=0; gets(a); gets(b); gets(c); if(a[strlen(a)-1]==b[0] && b[strlen(b)-1]==c[0] && c[strlen(c)-1]==a[0]){ printf("good"); } else{ printf("bad"); } } */ /* int main() { char a[501]={}; gets(a); int i,sum=0; for (i=0;a[i]!=0;i++){ sum+=a[i]-'0'; } printf("%d",sum%3==0); } */ /* int main() { char a[101]={}; char b[101]={}; scanf("%s %s",a,b); int i,k=0; if(strlen(a) == strlen(b)){ for(i=0;a[i]!=0;i++){ if(a[i]>b[i]){ printf("%s %s",b,a); break; } else if(a[i]<b[i]){ printf("%s %s",a,b); break; } } } else if(strlen(a) > strlen(b)){ printf("%s %s",b,a); } else{ printf("%s %s",a,b); } } */ /* int main() { char a[21]={}; gets(a); int i=0; for (i=0;a[i]!=0; i++){ printf("\'%c\'",a[i]); printf("\n"); } } */
0
0
1
dlatjdus222
2022년 5월 17일
In 소스 코드 제출
#include <stdio.h> #include <stdlib.h> /* int main() { int num[100][100]={}; int i, j, k, sum=0, x1, y1, x2, y2; for(k=0;k<4;k++){ scanf("%d %d %d %d",&x1,&y1,&x2,&y2); for(i=x1;i<x2;i++){ for(j=y1;j<y2;j++){ num[i][j]=1; } } } for(i=0;i<100;i++){ for(j=0;j<100;j++){ sum+=num[i][j]; } } printf("%d",sum); return 0; } */ /* int main() { int num[101][101]={}; int i, j, k,n, sum=0,x1,y1,x2=0,y2=0; scanf("%d",&n); for (k=0;k<n;k++){ scanf("%d %d",&x1,&y1); x2 = x1+10; y2 = y1+10; for(i=x1;i<x2;i++){ for (j=y1;j<y2;j++){ num[i][j]= 1; } } } for (i=1;i<101;i++){ for (j=1;j<101;j++){ sum += num[i][j]; } } printf("%d",sum); return 0; } */ /* int main() { char b; scanf("%c",&b); printf("%c",b); } */ /* int main() { char b[10]; scanf("%s",&b); printf("%s",b); } */ /* #include <string.h> int main() { char b[30]; //scanf("%s",b); // &b[0] ==b gets(b); printf("%s",b); } */ /* #include <string.h> int main() { char b[1000]; int i; gets(b); for(i=0;b[i];i++){ if(b[i] >= 'A'&& b[i] <='Z'){ printf("%c",b[i]+32); } else if (b[i] >= 'a'&& b[i] <='z'){ printf("%c",b[i]-32); } else{ printf("%c",b[i]); } } } */ /* #include <string.h> int main() { char b[10]={}; scanf("%s",b); if (strcmp(b ,"love")==0){ printf("I love you."); } return 0 ; } */ /* #include <string.h> int main() { char b[100]={}; int i; gets(b); for (i =0;b[i]!=NULL;i++){ if (b[i]!=' '){ printf("%c",b[i]); } } } */ /* #include <string.h> int main() { char b[20]={}; int i; gets(b); for(i=0;b[i]!=0;i++){ printf("%c",b[i]+2); } printf("\n"); for(i=0;b[i]!=0;i++){ printf("%c",((b[i]*7)%80+48)); } } */ /* #include <string.h> int main() { char b[100]={}; gets(b); int i,ssum=0,sum=0; for (i=0;b[i]!=0;i++){ if(b[i]=='c' || b[i]=='C'){ sum+=1; if(b[i+1]=='c'||b[i+1]=='C'){ ssum++; } } } printf("%d",sum); printf("\n"); printf("%d",ssum); } */
0
0
2
dlatjdus222
2022년 4월 07일
In 소스 코드 제출
#include <stdio.h> #include <stdlib.h> /* int main() { double h,w,a; double b= 0; double bi= 0; scanf("%lf %lf", &h, &w); if (h<150){ b=(h-100); } else if (150<= h && h<160){ b = (h-150)/2 +50; } else{ b = (h-100)*0.9; } bi = (w-b)*100/b; if(bi<=10){ printf("정상"); } else if(10< bi && bi<= 20){ printf("과체중"); } else{ printf("비만"); } } */ /* int main() { int a,b; double d = 0; char c; scanf("%d%c%d", &a,&c,&b); switch (c){ case '+': printf("%d",a+b); break; case'-': printf("%d",a-b); break; case'*': printf("%d",a*b); break; case'/': d= (double)a/b; printf("%.2f",d); break; } } */ /* int main(){ double a, b,i; scanf("%lf %lf", &a,&b); for(i=a;i<=b;i=i+0.01){ printf("%.2lf ",i); } } */ /* int main(){ int a, b,i; scanf("%d %d", &a,&b); for(i=a;i<=b;i++){ if (i%2==1){ printf("%d ",i); } } } */ /* int main(){ int a, b,i; int c=0; scanf("%d %d", &a,&b); for(i=a;i<=b;i++){ if (i%3==0){ c+=i; } } printf("%d ",c); } */ /* int main(){ int a,b,sum =0; scanf("%d",&a); for (int i=0; i<a;i++){ scanf("%d",&b); if (b%2==0){ sum+=1; } } printf("%d",sum); } */ /* int main(){ int a,i,j; scanf("%d",&a); for (int i=0;i<a/2+1;i++){ for (int j=a/2; j>i;j--){ printf("."); } for (int j=0; j<i*2+1;j++){ printf("*"); } printf("\n"); } } */ /* int main(){ int a; int i,j = 0; scanf("%d",&a); int num[1000]; for (int i=0; i<a;i++){ scanf("%d",&num[i]); } for (int i=0; i<a;i++){ for (int j=i; j<a ;j++){ printf("%d ",num[j]); } for (int j=0;j<i;j++){ printf("%d ",num[j]); } printf("\n"); } } */
0
0
1
dlatjdus222
2022년 2월 03일
In 소스 코드 제출
class Node: def __init__(self, key=None): self.key = key self.next = None def __str__(self): return str(self.key) class SinglyLinkedList: def __init__(self): self.head = None self.size = 0 def __len__(self): return self.size def printList(self): # 변경없이 사용할 것! v = self.head while (v): print(v.key, "->", end=" ") v = v.next print("None") def pushFront(self, key): new_node = Node(key) new_node.next = self.head self.head = new_node self.size += 1 def pushBack(self, key): new_node = Node(key) if self.size==0: self.head = new_node else: tail = self.head while tail.next != None: tail = tail.next tail.next = new_node self.size += 1 def popFront(self): key = value = None if len(self) > 0: key = self.head.key value = self.head.value self.head = self.head.next self.size -= 1 return key, value def popBack(self): if self.size == 0: return None else: prev = None tail = self.head while tail.next != None: prev = tail tail = tail.next if prev==None: self.head = None else: prev.next = tail.next key = tail.key del tail self.size -= 1 return key # tail 노드의 값 리턴. def search(self, key): v = self.head while v: if v.key == key: return v v = v.next return None def remove(self, key): v = L.search(key) if v == L.head: self.popFront(v) elif v != None : L.remove(v) # 노드 x를 제거한 후 True리턴. 제거 실패면 False 리턴 def size(self): return self.size L = SinglyLinkedList() while True: cmd = input().split() if cmd[0] == "pushFront": L.pushFront(int(cmd[1])) print(int(cmd[1]), "is pushed at front.") elif cmd[0] == "pushBack": L.pushBack(int(cmd[1])) print(int(cmd[1]), "is pushed at back.") elif cmd[0] == "popFront": x = L.popFront() if x is None: print("List is empty.") else: print(x, "is popped from front.") elif cmd[0] == "popBack": x = L.popBack() if x is None: print("List is empty.") else: print(x, "is popped from back.") elif cmd[0] == "search": x = L.search(int(cmd[1])) if x is None: print(int(cmd[1]), "is not found!") else: print(int(cmd[1]), "is found!") elif cmd[0] == "remove": x = L.search(int(cmd[1])) if L.remove(x): print(x.key, "is removed.") else: print("Key is not removed for some reason.") elif cmd[0] == "printList": L.printList() elif cmd[0] == "size": print("list has", len(L), "nodes.") elif cmd[0] == "exit": print("DONE!") break else: print("Not allowed operation! Enter a legal one!")
0
0
14
dlatjdus222
2022년 1월 27일
In 소스 코드 제출
""" class deque: def __init__(self, s): self.items = [] def append(self, c): self.items.append(c) def appendleft(self, c): self.items += self.items.append(c) def pop(self): try: return self.items.pop() except IndexError: print("empty") def popleft(self): try: return self.items.pop(0) except IndexError: print("empty") def __len__(self): return len(self.items) def right(self): return self.items[-1] def left(self): return self.items[0] def check_palindrome(s): dq = deque(s) for i in range(len(s)): dq.append(s[i]) palindrome = True while len(dq)> 1: if dq.popleft() != dq.pop(): palindrome = False return print(palindrome) a = input() check_palindrome(a) """ class Node: def __init__(self, key=None): self.key = key self.next = None def __str__(self): return str(self.key) class SinglyLinkedList: def __init__(self): self.head = None self.size = 0 def __len__(self): return self.size def printList(self): # 변경없이 사용할 것! v = self.head while (v): print(v.key, "->", end=" ") v = v.next print("None") def pushFront(self, key): new_node = Node(key) new_node.next = self.head self.head = new_node self.size += 1 def pushBack(self, key): new_node = Node(key) if self.size==0: self.head = new_node else: tail = self.head while tail.next != None: tail = tail.next tail.next = new_node self.size += 1 def popFront(self): # head 노드의 값 리턴. empty list이면 None 리턴 def popBack(self): # tail 노드의 값 리턴. empty list이면 None 리턴 def search(self, key): # key 값을 저장된 노드 리턴. 없으면 None 리턴 def remove(self, x): # 노드 x를 제거한 후 True리턴. 제거 실패면 False 리턴 def size(self): return self.size
0
0
3
dlatjdus222
2022년 1월 20일
In 소스 코드 제출
data = input().split() stackNum = [] stackOp = [] topNum = 0 topOp = 0 result = 0 # using Dictionary opChange = {'+':1, '-':1, '*':2, '/':2} for i in range(len(data)): if data[i] == '+' or data[i] == '-' or data[i] == '*' or data[i] == '/': if topOp == 0: stackOp.append(data[i]) topOp += 1 else: if stackOp[topOp-1] == '+' or stackOp[topOp-1] == '-': # + - stackOp.append(data[i]) topOp += 1 else: # * / if data[i] == '+' or data[i] == '-': v1 = stackNum.pop() topNum -= 1 v2 = stackNum.pop() topNum -= 1 o1 = stackOp.pop() topOp -= 1 if o1 == '*': vr = v1 * v2 stackNum.append(vr) topNum += 1 else: vr = v1 // v2 stackNum.append(vr) topNum += 1 stackOp.append(data[i]) topOp += 1 else: stackOp.append(data[i]) topOp += 1 else: stackNum.append(int(data[i])) topNum += 1 print(stackNum) print(stackOp)
0
0
1
dlatjdus222
2021년 12월 05일
In 소스 코드 제출
import java.util.*; import java.util.InputMismatchException; //추상 클래스 abstract class info { protected String name;//환자명 protected int age;//환자 나이 //생성자 public info (String name) { this.name = name; } //오버로딩 public info (String name, int age) { this.name = name; this.age = age; } public void showinfo() { System.out.println("- 환자명 : "+ name); System.out.println("- 환자 나이 : "+ age); } }//abstract class info //클래스 상속 class hospital_info extends info{ private String doctor;//담당의사 public hospital_info(String name, int age, String doctor) { super(name,age); this.doctor = doctor; } //메소드 오버라이딩 //다중 스레드 public void showinfo() { System.out.println("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); System.out.println("[ 미소내과의원 ]"); super.showinfo(); System.out.println("# 담당의사 : "+doctor); System.out.println("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); } }//class hospital_info extends info //인터페이스 아픈곳으로 다중인터페이스 구현 interface Aachlist{ String achlist_add(String hlist); }//interface Aachlist interface Aemedlist{//복용중인약 String emedlist_add(String hlist); }//interface Aemedlist class hos_achlist implements Aachlist,Aemedlist{ String hlist; public String achlist_add(String hlist) { this.hlist =hlist; return hlist; } public String emedlist_add(String hlist) { this.hlist =hlist; return hlist; } public void show_hachlist(String achlist[]) {//아픈곳 if(achlist.length>0) { System.out.print("아프신 곳은 "); for(int i = 0;i<achlist.length;i++) { if(achlist[i]!=null) { System.out.print(achlist[i]+" "); }//if null }//for System.out.println("맞나요?"); }//if else { System.out.println(""); }//else }//show_hachlist(String achlist[]) public void show_hmedlist(String emedlist[]){//복용중인약 if(emedlist.length>0) { System.out.print("복용중인 약은 "); for(int i = 0;i<emedlist.length;i++) { if(emedlist[i]!=null) { System.out.print(emedlist[i]+" "); }//if null }//for System.out.println("맞나요?"); }//if else { System.out.println("네 알겠습니다."); }//else }//show_hmedlist(String emedlist[] }//hos_achlist //main class public class Main { public static void main(String[] args) { Scanner t= new Scanner(System.in); String achlist[] = new String[5];//아픈곳 리스트 String emedlist[] = new String[5];//복용중인 약 int acnt = 0;//아픈곳 개수 int mcnt = 0; info abc ;//다형성 String hos_doctor = "최병옥"; System.out.println("안녕하세요 여기는 미소내과의원입니디."); System.out.println("일반 진료는 1번 코로나백신진료는 2번을 입력하세요."); int num = t.nextInt(); int a=1;//wrapper System.out.println((Integer)a); System.out.println("나이 또는 연세가 어떻게 되나요?"); int hos_age = t.nextInt(); System.out.println("이름은 어떻게 되나요?"); String hos_name = t.next(); // String achlist[] = new String[5];//아픈곳 리스트 // String emedlist[] = new String[5];//복용중인 약 // int acnt = 0;//아픈곳 개수 // int mcnt = 0; if(num==1) { System.out.println("대기해 주세요. "); System.out.println("아픈곳이 있으시다면 'yes'없다면 'no'라고 입력해주세요 "); String ach = t.next(); if(ach.equals("yes")== true) { hos_achlist Aadd = new hos_achlist(); while(acnt <= 5) { String aaaaa = t.next(); achlist[acnt] =Aadd.achlist_add(aaaaa) ; acnt++; Aadd.show_hachlist(achlist); System.out.println("아픈곳이 더 있나요 있다면 'yes'없다면 'no"); String ags = t.next(); if(ags.equals("no")) break; }//while acnt <= 5 }//if ach.equals"yes" else { System.out.println("네 알겠습니다."); }//else if (ach.equals("no" }//if num=1 else { //예외처리 주사 1,2,3 이 아닌 경우 ("백신주사는 1부터 3까지만 입력할수 있습니다. ") System.out.println("백신이 처음 접종이시면 1번 두번째 접종이면 2번을 입력해 주세요 "); int numm = t.nextInt(); if(numm == 1) { System.out.println("예약한 주사가 무엇인가요? "); System.out.println("1.모더나 2.화이자 3.아스트라제네카 "); //try 문 int junum ; try { junum= t.nextInt(); abc = new hospital_info( hos_name, hos_age, hos_doctor); abc.showinfo(); if (junum==1) { System.out.println("1차접종후 4주(또는 28일)후에 2차접종을 받으세요"); System.out.println("밖에서 30분 있다 가셔야돼요"); System.out.println("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); }//주사 if else if (junum ==2) { System.out.println("1차접종후 3주(또는 21일)후에 2차접종을 받으세요"); System.out.println("밖에서 30분 있다 가셔야돼요"); System.out.println("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); }//주사 else if else { System.out.println("1차접종후 4주 ~ 12주안에 2차접종을 받으세요"); System.out.println("밖에서 30분 있다 가셔야돼요"); System.out.println("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); }//주사else }//try catch (InputMismatchException e){ System.out.println("숫자로 입력해주세요."); }//catch }//처음 접종 //2차접종 else { System.out.println("맞았던 주사가 무엇인가요? "); System.out.println("1.모더나 2.화이자 3.아스트라제네카 "); //try 문 int junumm ; try { junumm= t.nextInt(); abc = new hospital_info( hos_name, hos_age, hos_doctor); abc.showinfo(); if (junumm==1) { System.out.println("밖에서 30분 있다 가셔야돼요"); System.out.println("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); }//주사 if else if (junumm ==2) { System.out.println("밖에서 30분 있다 가셔야돼요"); System.out.println("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); }//주사 else if else { System.out.println("밖에서 30분 있다 가셔야돼요"); System.out.println("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); }//주사else }//try catch (InputMismatchException e){ System.out.println("숫자로 입력해주세요."); }//catch }//2차접종 }//일반 코로나 접종 System.out.println("예방 접종후 주의 사항입니다."); System.out.println("예방접종 후 3시간 이상 주의 깊게 관찰합니다."); System.out.println("일주일 정도는 고강도 운동 및 활동, 음주를 삼가주세요."); System.out.println("평소와 다른 신체 증상이 나타나면 바로 의사의 진료를 받으세요"); System.out.println("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); System.out.println("안녕히가세요~~!"); }//string }//main
0
0
2
dlatjdus222
2021년 12월 05일
In 소스 코드 제출
import java.util.*; import java.util.InputMismatchException; //추상 클래스 abstract class info { protected String name;//환자명 protected int age;//환자 나이 //생성자 public info (String name) { this.name = name; } //오버로딩 public info (String name, int age) { this.name = name; this.age = age; } public void showinfo() { System.out.println("-환자영 : "+ name); System.out.println("-환자 나이 : "+ age); } }//abstract class info //클래스 싱속 class hospital_info extends info{ private String doctor;//담당의사 public hospital_info(String name, int age, String doctor) { super(name,age); this.doctor = doctor; } //메소드 오버라이딩 //다중 스레드 public void showinfo() { System.out.println("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); System.out.println("[ 미소내과의원 ]"); super.showinfo(); System.out.println("*담당의사 : "+doctor); System.out.println("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); } }//class hospital_info extends info //인터페이스 약처방으로 다중인터페이스 구현 //main class public class Main { private static final String String = null; public static void main(String[] args) { Scanner t= new Scanner(System.in); String medwishlist[] = new String[10];//약구매 리스트 int cnt =0;//약처방 개수 System.out.print("안녕하세요 여기는 미소내과의원입니디.\n"); System.out.print("일반 질료는 1번 코로나백신진료는 2번을 입력하세요.\n"); String hos_doctor = t.next("Dr.박병옥"); int num = t.nextInt(); System.out.print("나이 또는 연세가 어떻게 되냐요?\n"); int hos_age = t.nextInt(); System.out.print("이름은 어떻게 되냐요?\n"); String hos_name = t.next(); while (cnt <=10) { if(num==1) { System.out.println("이름을 적으시고 대기해 주세요.\n "); //아픈 증사있는지 인터페이스? } else { //나이대별 추천 주사 //예외처리 주사 1,2,3 이 아닌 경우 ("백신주사는 1부터 3까지만 입력할수 있습니다. ") System.out.println("백신이 처음 접종이시면 1번 두번째 접종이면 2번을 입력해 주세요 "); int numm = t.nextInt(); if(numm == 1) { System.out.println("예약한 주사가 무엇인가요? "); System.out.println("1.모더나 2.화이자 3.아스트라제네카 "); try { int junum = t.nextInt(); hospital_info jjnum = new hospital_info( hos_name, hos_age, hos_doctor); jjnum.showinfo(); if(junum==1) { System.out.println("1차접종후 4주(또는 28일)후에 2차접종을 받으세요"); System.out.println("밖에서 30분 있다 가셔야되요"); }//주사 if else if (junum ==2) { System.out.println("1차접종후 3주(또는 21일)후에 2차접종을 받으세요"); System.out.println("밖에서 30분 있다 가셔야되요"); }//주사 ifelse else { System.out.println("1차접종후 4주 ~ 12주안에 2차접종을 받으세요"); System.out.println("밖에서 30분 있다 가셔야되요"); }//주사else }//try catch (InputMismatchException e) { System.out.println("백신주사는 1부터 3까지만 입력할수 있습니다. "); }//catch }//처음 접종 else { System.out.println("맞았던 주사가 무엇인가요? "); System.out.println("1.모더나 2.화이자 3.아스트라제네카 "); int junumm = t.nextInt(); if(junumm==1) { System.out.println("밖에서 30분 있다 가셔야되요"); }//주사 if else if(junumm ==2) { System.out.println("밖에서 30분 있다 가셔야되요"); }//주사 elseif else { System.out.println("밖에서 30분 있다 가셔야되요"); }//주사else }//2차접종 }//일반 코로나 접종 System.out.println("예방 접종후 주의 사항입니다."); System.out.println("예방접종 후 3시간 이상 주의 깊게 관찰합니다."); System.out.println("일주일 정도는 고강도 운동 및 활동, 음주를 삼가주세요."); System.out.println("평소와 다른 신체 증상이 나타나면 바로 의사의 진료를 받도록 합니다."); }//while System.out.println("안녕히가세요!"); }//sting }//main
0
0
1
dlatjdus222
2021년 11월 07일
In 소스 코드 제출
import java.util.*; //2 // //class Grade{ // private int math,science,english; // public Grade (int math,int science,int english){ // this.math= math; // this.science = science; // this.english = english; // } // public int average (){ // return (math+science+english)/3; // // } //} // //public class Main { // // public static void main(String[] args) { // Scanner t= new Scanner(System.in); // // System.out.println("수학, 과학, 영어 순으로 3개의 점수 입력>>"); // int math = t.nextInt(); // int science = t.nextInt(); // int english = t.nextInt(); // // Grade me = new Grade(math, science, english); // System.out.println("평균은 "+ me.average()); // // // } // //} //4 /*class Rectangle{ int x,y,width,height; public Rectangle(int x,int y,int width,int height) { this.x=x; this.y=y; this.width= width; this.height= height; } public int square() { return width*height; } public void show(){ System.out.println("("+x+","+y+")에서 크키가 "+width+"x"+height+"인 사각형"); } public boolean contains(Rectangle r) { if(r.x>x&&r.y>y&&r.width+r.x<x+width&&r.height+r.y<y+height) { return true; } else return false; } } public class Main{ public static void main(String[] args) { Rectangle r = new Rectangle(2,2,8,7); Rectangle s = new Rectangle(5,5,6,6); Rectangle t = new Rectangle(1,1,10,10); r.show(); System.out.println("s의 면적은 "+ s.square()); if(t.contains(r)) System.out.println("t는 r을 포함합니다."); if(t.contains(s)) System.out.println("t는 s을 포함합니다."); } } */ //6 /* class Circle{ private double x,y; private int radius; public Circle (double x, double y, int radius) { this.x=x; this.y=y; this.radius=radius; } public void show() { System.out.println("가장 면적이 큰 원은 ("+x+","+y+")"+radius); } public int getr() { return radius; } } public class Main{ public static void main(String[] args) { Scanner t = new Scanner(System.in); Circle c [] = new Circle [3];//3개의 서클 배열 for(int i=0; i<c.length ;i++) { System.out.print("x, y, radius >>"); double x = t.nextDouble(); double y = t.nextDouble(); int radius = t.nextInt(); c[i] = new Circle(x,y,radius); } int max=0; for (int i=0; i<c.length;i++) { if(c[max].getr()<c[i].getr()) max=i; } c[max].show(); } }*/ class Phonebook{ String name, tel; public Phonebook (String name, String tel) { this.name=name; this.tel=tel; } } public class Main{ public static void main(String[] args) { Scanner t = new Scanner(System.in); System.out.print("인원수>>>"); int num = t.nextInt(); Phonebook phb [] = new Phonebook [num]; for(int i=0; i<=phb.length ;i++) { System.out.print("이름과 전화번호(이름과 번호는 빈 칸 없이 입력)>>"); String name = t.nextLine(); String tel = t.nextLine(); phb[i] = new Phonebook(name,tel); } System.out.println("저장되었습니다..."); } }
0
0
2
dlatjdus222
2021년 9월 05일
In 소스 코드 제출
//import java.util.*; // //class Book{ // String title, author; // public Book(String title,String author) { // this.title = title; // this.author = author; // // } //} // // // //public class Main { // public static void main(String[] args) { // Book [] book = new Book[2]; // Scanner t = new Scanner(System.in); // for (int i=0;i<book.length;i++) { // System.out.print("제목>>"); // String title = t.nextLine(); // System.out.print("저자>>"); // String author = t.nextLine(); // book[i] = new Book(title, author); // } // for(int i= 0; i<book.length;i++) { // System.out.print("("+book[i].title + ", "+book[i].author + ")"); // } // } //} //import java.util.*; // //class Tv{ // String logo; // int year,inch; // public Tv(String logo, int year, int inch) { // this.logo = logo; // this.year = year; // this.inch = inch; // } // void show() { // System.out.println(logo +"에서 만든 "+year+"년형 "+inch+"인치 TV"); // } // //} // //public class Main { // public static void main(String[] args) { // Tv myTv = new Tv("LG",2017,32); // myTv.show(); // } //} //import java.util.*; // //class Grade{ // int math,science,english; // public Grade (int math, int science, int english) { // this.math = math; // this.science = science; // this.english = english; // // } // public int average() { // return (math+science+english)/3; // } //} // //public class Main { // public static void main(String[] args) { // Scanner t = new Scanner(System.in); // System.out.print("수학, 과학, 영어 순으로 3개의 점수 입력>>"); // int math = t.nextInt(); // int science = t.nextInt(); // int english = t.nextInt(); // Grade me = new Grade(math, science, english); // System.out.println("평균은 "+ me.average()); // // } //} // //import java.util.*; // //class Grade{ // private int math,science,english; // public Grade (int math, int science, int english) { // this.math = math; // this.science = science; // this.english = english; // } // public int average() { // return (math+science+english)/3; // } //} // //public class Main { // public static void main(String[] args) { // Scanner t = new Scanner(System.in); // System.out.print("수학, 과학, 영어 순으로 3개의 점수 입력>>"); // int math = t.nextInt(); // int science = t.nextInt(); // int english = t.nextInt(); // Grade me = new Grade(math, science, english); // System.out.println("평균은 "+ me.average()); // // } //} // //import java.util.*; // //class parents { // int a, b, c; // // parents() { // System.out.println("Parents Contructor Base"); // } // // parents(int a, int b, int c) { // this.a = a; // this.b = b; // this.c = c; // System.out.println("Parents Contructor Extend"); // } // // void show() { // System.out.println("I'''m your parentss"); // } //} // //class child extends parents { // child() { // System.out.println("Child Constructor Base"); // } // child(int a) { // super(10, 20, 30); // this.a = a; // System.out.println("Exte"); // } // // void show() { // System.out.println("IM YOUR ^^"); // } //} // //public class Main { // public static void main(String[] args) { // Scanner t = new Scanner(System.in); // // child c = new child(10); // // c.a = 10; // c.show(); // } //} // import java.util.*; class Point{ private int x,y; public void set(int x, int y) { this.x= x; this.y= y; } public void showPoint() { System.out.println("("+ x+","+y +")"); } } class ColorPoint extends Point{ private String color; public void setColor(String color) { this.color = color; } public void showColorPoint() { System.out.print(color); showPoint(); } } public class Main{ public static void main(String[] args) { Point p = new Point(); p.set(1,2); p.showPoint(); ColorPoint cp = new ColorPoint(); cp.set(3,4); cp.setColor("red"); cp.showColorPoint(); } }
0
0
1
dlatjdus222
2021년 8월 26일
In 소스 코드 제출
//import java.util.*; /* public class Main { public static void main(String[] args) { Scanner t = new Scanner(System.in); int n = t.nextInt(); int arr[] = new int[n]; for (int i = 0; i<n;i++) { arr[i] = t.nextInt(); } for(int i = 0;i<n;i++) { for(int j = i ;j<n;j++) { System.out.print(arr[j]+" "); } for(int j=0;j<i;j++) { System.out.print(arr[j]+" "); } System.out.println(); } } } */ //public class Main //{ // public static void main(String[] args) { // Scanner t = new Scanner(System.in); // String a=t.next(); // String b=t.next(); // if(a.equals(b)) System.out.println("true"); // else System.out.println("false"); // // // //System.out.println(a+"abcd"+a.charAt(0)); // } // //} //import java.util.*; // //public class Main { // public static void main(String[] args) { // Scanner t= new Scanner(System.in); // String a = t.nextLine(); // System.out.println(a); // } //} //import java.util.*; // //public class Main { // public static void main(String[] args) { // Scanner t = new Scanner(System.in); // String a = t.next(); // String b = t.next(); // if(a.length()<b.length()) { // System.out.print(a+" "+b); // } // else if(a.length()>b.length()) { // System.out.print(b+" "+a); // // } // else // { // char [] c= new char[a.length()]; // char [] d = new char [b.length()]; // for (int i= 0;i<a.length();i++) { // c[i] = a.charAt(i); // d[i] = b.charAt(i); // if(c[i]<d[i]) { // System.out.println(a+" "+b); // break; // } // else if(c[i]>d[i]) { // System.out.println(b+" "+a); // break; // } // else { // i++; // } // // } // // } // } //} //import java.util.*; // //public class Main{ // public static void main(String[] args) { // Scanner t = new Scanner(System.in); // String a = t.next(); // char arr[] = new char[a.length()]; // int k = 0; // for(int i = 0;i<a.length();i++) { // arr[i] = a.charAt(i); // k+=arr[i]; // // } // if(k%3==0) { // System.out.println("1"); // } // else { // System.out.println("0"); // } // // } //} //import java.util.*; // //public class Main{ // public static void main(String[] args) { // Scanner t = new Scanner(System.in); // String a = t.next(); // String b = t.next(); // String c = t.next(); // // // if(a.charAt(a.length()-1)==b.charAt(0)&& b.charAt(b.length()-1)==c.charAt(0)&&c.charAt(c.length()-1)==a.charAt(0)) { // System.out.println("good"); // } // else { // System.out.println("bad"); // } // } //} /* import java.util.*; public class Main{ public static void main(String[] args) { Scanner t = new Scanner(System.in); String a = new String(" C#"); String b = new String(",C++ "); System.out.println(a+"의 길이는 "+ a.length()); System.out.println(a.contains("#")); a = a.concat(b); System.out.println(a); a = a.trim(); System.out.println(a); a = a.replace("C#", "Java"); System.out.println(a); String s[] = a.split(","); for (int i =0;i<s.length;i++) { System.out.println("분리된 문자열"+ i +": "+s[i]); } a = a.substring(5); System.out.println(a); char c = a.charAt(2); System.out.println(c); } } */ /* import java.util.*; class Person { String name; int age; } class Student extends Person { double grade; } public class Main{ public static void main(String[] args) { Person p; p = new Person(); } } */ //import java.util.*; //class Circle{ // int radius; // String name; // // public double getArea() { // return 3.14*radius*radius; // } //} //public class Main{ // public static void main(String[] args) { // Circle pizza = new Circle(); // pizza.radius = 10; // pizza.name = "자바피자"; // double area = pizza.getArea(); // System.out.println(pizza.name+"의 면적은 "+ area); // // Circle donut = new Circle(); // donut.name = "자바도넛"; // donut.radius = 2; // area = donut.getArea(); // System.out.println(donut.name+"의 면적은 "+area); // // } //} //import java.util.*; // //class Rectangle{ // int width; // int hight; // public Rectangle () // { // width=5; // hight=5; // } // public Rectangle(int width, int height) // { // this.width=width; // this.hight=height; // } // public int getArea() { // return width*hight; // } //} // //public class Main { // public static void main(String[] args) { // //Rectangle rect = new Rectangle(); // Scanner sc = new Scanner(System.in); // //System.out.print(">> "); // int a = sc.nextInt(); // int b = sc.nextInt(); // Rectangle rect = new Rectangle(a,b); // System.out.println("사각형의 면적은 "+rect.getArea()); // sc.close(); // } //} //import java.util.*; // //class Circle{ // int radius; // String name; // public Circle() { // radius = 1; // name = ""; // } // public Circle(int radius,String name) { // this.radius = radius; // this.name = name; // } // public double getArea() { // return radius*radius*3.14; // } //} //public class Main{ // public static void main(String[] args) { // Circle pizza = new Circle(10,"자바피자"); // double area = pizza.getArea(); // System.out.println(pizza.name+"의 면적은"+area); // // Circle donut = new Circle (); // donut.name = "도넛피자"; // area = donut.getArea(); // System.out.println(donut.name+"의 면적은"+area); // // } //} //import java.util.*; // //class Book { // String title; // String author; // public Book(String title) { // this.title = title; // author = "작자미상"; // // } // public Book (String title,String author) { // this.title = title; // this.author = author; // // } //} //public class Main { // public static void main(String[] args) { // Book littlePrince = new Book("어린왕자","생택쥐페리"); // Book loveStory = new Book("춘향전"); // System.out.println(littlePrince.title+" "+littlePrince.author); // System.out.println(loveStory.title+" "+loveStory.author); // // // // } //} //import java.util.*; // //class Book { // String title; // String author; // void show() {System.out.println(title+" "+author);} // public Book() { // this("",""); // System.out.println("생성자 호출됨"); // } // public Book(String title) { // this.title = title; // author = "작자미상"; // // } // public Book (String title,String author) { // this.title = title; // this.author = author; // // } //} //public class Main { // public static void main(String[] args) { // Book littlePrince = new Book("어린왕자","생택쥐페리"); // Book loveStory = new Book("춘향전"); // Book emptyBook = new Book(); // loveStory.show(); // // // } //}
0
0
3
dlatjdus222
2021년 8월 05일
In 소스 코드 제출
//import java.util.*; // //public class Main { // public static void main(String[] args) { // Scanner t = new Scanner(System.in); // // int n = t.nextInt(); // // for(int i =0;i<n;i++) { // // for (int j =0;j<n;j++){ // System.out.printf("*"); // } // System.out.printf("\n"); // } // // } //} //import java.util.*; // //public class Main { // public static void main(String[] args) { // Scanner t = new Scanner(System.in); // // int n = t.nextInt(); // // for(int i =0;i<n;i++) { // for (int j =0;j<n;j++){ // if(i==0||j==0||i==n-1||j==n-1) // System.out.printf("*"); // else { // System.out.print(" "); // } // } // System.out.println(); // } // // } //} //import java.util.*; // //public class Main { // public static void main(String[] args) { // Scanner t = new Scanner(System.in); // // int n = t.nextInt(); // // for(int i =0;i<n;i++) { // for (int j =0;j<n;j++){ // if(i==0||j==0||i==n-1||j==n-1||j==n-i-1||i==j) // System.out.printf("*"); // else { // System.out.print(" "); // } // } // System.out.println(); // } // // } //} //import java.util.*; // //public class Main { // public static void main(String[] args) { // Scanner t = new Scanner(System.in); // // int n = t.nextInt(); // // for(int i =0;i<n;i++) { // for (int j =0;j<n;j++){ // if(i==0||j==0||i==n-1||j==n-1||j==n-i-1||i==j||j==n-j-1||i==n/2) // System.out.printf("*"); // else { // System.out.print(" "); // } // } // System.out.println(); // } // // } //} //import java.util.*; // //public class Main { // public static void main(String[] args) { // Scanner t = new Scanner(System.in); // // int n = t.nextInt(); // // for(int i =0;i<n;i++) { // // for (int j =0;j<=i;j++){ // System.out.print("*"); // } // System.out.println(); // } // // } //} //import java.util.*; // //public class Main { // public static void main(String[] args) { // Scanner t = new Scanner(System.in); // // int n = t.nextInt(); // // for(int i =0;i<n;i++) { // // for (int j =0;j<=i;j++){ // System.out.print("*"); // } // System.out.println(); // } // for(int i=n-2;i>=0;i--) { // for (int j =0; j<=i;j++) { // System.out.print("*"); // } // System.out.println(); // } // // } //} //import java.util.*; // //public class Main { // public static void main(String[] args) { // Scanner t = new Scanner(System.in); // // int n = t.nextInt(); // // for(int i =0;i<n/2+1;i++) { // for (int j =n-i;j>n/2+1;j--){ // System.out.print(" "); // } // for (int j =0;j<=i*2;j++){ // System.out.print("*"); // } // System.out.println(); // } // // } //} //import java.util.*; // //public class Main{ // public static void main(String[] args) { // Scanner t = new Scanner(System.in); // // int n = t.nextInt(); // int h = t.nextInt(); // // for(int i =0;i<n;i++) { // for (int j =0;j<n;j++){ // if(i==0||j==0||i==n-1||j==n-1) // System.out.printf("*"); // else if((i+j+1)%h==0) { // System.out.print("*"); // } // else { // System.out.print(" "); // } // } // System.out.println(); // } // // // } //} //import java.util.*; // //public class Main { // public static void main(String[] args) { // Scanner t = new Scanner(System.in); // // int arr[] = new int[10]; // // for(int i=0; i<10; i++) { // arr[i] = t.nextInt(); // } // int a = t.nextInt(); // System.out.print(arr[a-1]); // } //} //import java.util.*; // //public class Main { // public static void main(String[] args) { // Scanner t = new Scanner(System.in); // // int n = t.nextInt(); // int sum = 0; // int sum1 = 0; // int arr[] = new int [n]; // for (int i=0; i<n-1; i++) { // arr[i] = t.nextInt(); // sum +=arr[i]; // } // for (int i=0;i<=n;i++) { // sum1+=i; // } // System.out.println(sum1-sum); // // } //} //import java.util.*; // //public class Main { // public static void main(String[] args) { // Scanner t = new Scanner(System.in); // // int arr[] = new int[24]; // int n = t.nextInt(); // for (int i = 1; i<=n;i++) { // int s = t.nextInt(); // arr[s] = arr[s]+1; // } // for(int i = 1; i<=23;i++) { // System.out.print(arr[i]+" "); // } // // } //} //import java.util.*; // //public class Main { // public static void main(String[] args) { // Scanner t = new Scanner(System.in); // // int arr[] = new int[24]; // int n = t.nextInt(); // int a = 1; // for (int i = 1; i<=n;i++) { // int s = t.nextInt(); // arr[s] = arr[s]+1; // } // for(int i = 1; i<=23;i++) { // if (arr[i]>= 1) { // System.out.println(i); // break; // } // } // // } //} import java.util.*; public class Main { public static void main(String[] args) { Scanner t = new Scanner(System.in); int n = t.nextInt(); int arr[] = new int[n]; for (int i = 1; i<=n;i++) { arr[i] = t.nextInt(); } for (int i = 1;i<=n;i++) { } } }
0
0
2
dlatjdus222
2021년 7월 29일
In 소스 코드 제출
/* import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner t = new Scanner(System.in); long a = t.nextLong(); long b = t.nextLong(); System.out.println(a+b); } } */ /* import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner t = new Scanner(System.in); long a = t.nextLong(); System.out.println(-a); } } */ //import java.util.Scanner; // //public class Main { // public static void main(String[] args) { // Scanner t = new Scanner(System.in); // // int a = t.nextInt(); // int b = t.nextInt(); // // System.out.println(a/b); // // } //} //import java.util.Scanner; // //public class Main { // public static void main(String[] args) { // Scanner t = new Scanner(System.in); // // long a = t.nextLong(); // // // System.out.println(a+1); // // } //} //import java.util.Scanner; // //public class Main { // public static void main(String[] args) { // Scanner t = new Scanner(System.in); // // int a = t.nextInt(); // int b =t.nextInt(); // int c = t.nextInt(); // // System.out.println(a+b+c); // System.out.printf("%.1f",(float)(a+b+c)/3); // // } //} //import java.util.Scanner; // //public class Main { // public static void main(String[] args) { // Scanner t = new Scanner(System.in); // // int a = t.nextInt(); // int b =t.nextInt(); // int c = t.nextInt(); // if (a+b>c) // { // if(a==b && b==c && c==a) { // System.out.println("정삼각형"); // } // else if (a==b || b==c || c==a) { // System.out.println("이등변삼각형"); // } // else if (a*a + b*b==c*c) { // System.out.println("직각삼각형"); // } // else { // System.out.println("삼각형"); // } // } // else { // System.out.println("삼각형아님"); // } // } //} //import java.util.Scanner; // //public class Main { // public static void main(String[] args) { // Scanner t = new Scanner(System.in); // // int a = t.nextInt(); // int b =t.nextInt(); // int c = t.nextInt(); // if (a>b&& a>c) // { // if (a<b+c) { // System.out.println("yes"); // } // else { // System.out.println("no"); // } // else if (b>a&& b>c) { // if (b<a+c) { // System.out.println("yes"); // } // else { // System.out.println("no"); // } // } // else { // if(c<a+b) { // System.out.println("yes"); // } // else { // System.out.println("no"); // } // } // } //} //import java.util.Scanner; // //public class Main { // public static void main(String[] args) { // Scanner t = new Scanner(System.in); // // int a = t.nextInt(); // int b =t.nextInt(); // // if(a==90) // { // System.out.println(b); // } // else if(a%5==0) // { // System.out.println((90-a)/5+b); // } // else { // System.out.println((90-a)/5+1+b); // } // // } //} //import java.util.Scanner; // //public class Main { // public static void main(String[] args) { // Scanner t = new Scanner(System.in); // // int a = t.nextInt(); // int b = t.nextInt(); // if(b<30) { // if(a==0) { // System.out.printf("%d %d",23,60-(30-b)); // } // else { // System.out.printf("%d %d",(a-1),60-(30-b)); // } // } // else { // System.out.printf("%d %d",(a),(b-30)); // } // // } //} //import java.util.Scanner; // //public class Main { // public static void main(String[] args) { // Scanner t = new Scanner(System.in); // // int a = t.nextInt(); // int v = 0; // // if (a<10) { // v = a%10*10*2; // if(v>100) { // v = v-100; // if(v<=50) { // System.out.println(v); // System.out.println("GOOD"); // } // else { // System.out.println(v); // System.out.println("OH MY GOD"); // } // } // else { // if(v<=50) { // System.out.println(v); // System.out.println("GOOD"); // } // else { // System.out.println(v); // System.out.println("OH MY GOD"); // } // } // } // else { // v = (((a%10)*10)+(a/10))*2; // if(v>100) { // v = v-100; // if(v<=50) { // System.out.println(v); // System.out.println("GOOD"); // } // else { // System.out.println(v); // System.out.println("OH MY GOD"); // } // // } // else { // if(v<=50) { // System.out.println(v); // System.out.println("GOOD"); // } // else { // System.out.println(v); // System.out.println("OH MY GOD"); // } // } // } // } //} //import java.util.Scanner; // //public class Main { // public static void main(String[] args) { // Scanner t = new Scanner(System.in); // // int a = t.nextInt(); // int b = t.nextInt(); // int c = t.nextInt(); // // if (a> b&& a>c) { // // if (b>c) { // System.out.println(b); // } // else { // System.out.println(c); // } // } // else if (b>a&&b>c) { // if(a>c) { // System.out.println(a); // } // else { // System.out.println(c); // } // } // else { // if(a>b) { // System.out.println(a); // } // else { // System.out.println(b); // } // // } // } //} //import java.util.*; // //public class Main { // public static void main(String[] args) { // Scanner t = new Scanner(System.in); // // int n = t.nextInt(); // // int arr[] = new int[n]; // // for(int i=0; i<n; i++) { // arr[i] = t.nextInt(); // } // // for(int i=n-1; i>=0; i--) { // System.out.print(arr[i]+" "); // } // } //} import java.util.*; public class Main { public static void main(String[] args) { Scanner t = new Scanner(System.in); int n = t.nextInt(); int arr[] = new int[n]; for(int i=0; i<n; i++) { arr[i] = t.nextInt(); System.out.print(arr[i]+" "); } System.out.println(); for (int i = 1; i<n ;i++ ) { System.out.print(arr[i]+" "); } System.out.println(); for(int i=n-1; i>=0; i--) { System.out.print(arr[i]+" "); } } }
0
0
4
dlatjdus222
2021년 7월 22일
In 소스 코드 제출
/* #include <stdio.h> int main() { int a,b; scanf("%d %d",&a,&b); if (b<30) { b = 60-(30-b); if (a==0) { printf("%d %d", 23,b); } else { printf("%d %d",a-1,b); } } else { printf("%d %d", a,b-30); } return 0; } */ /* #include <stdio.h> int main() { int a; scanf("%d",&a); if (a%10==1 && a!=11) { printf("%dst",a); } else if(a%10==2 && a!=12) { printf("%dnd",a); } else if(a%10==3 && a!=13) { printf("%drd",a); } else { printf("%dth",a); } return 0; } */ /* #include<iostream>> using namespace std; int main() { int a, b, c; cin >> a>> b>> c; if (c>=a && c>=b){ if (c< a+b){ cout << "yes" ; } else { cout << "no" ; } } else if(b>=a && b>=c) { if (b< a+c){ cout << "yes" ; } else { cout << "no" ; } } else if(a>=b && a>=c){ if (a< c+b){ cout << "yes" ; } else { cout << "no" ; } } } */ /* #include <stdio.h> int main() { int a,b,c; scanf("%d %d %d",&a,&b,&c); if (a>170) { if (b>170) { if(c>170) { printf("PASS"); } else { printf("CRASH %d",c); } } else { printf("CRASH %d",b); } } else { printf("CRASH %d",a); } return 0; } */ /* #include<iostream>> using namespace std; int main() { int a, b, c; cin >> a>> b>> c; if (c>=a && c>=b){ if (c< a+b){ cout << "yes" ; } else { cout << "no" ; } } else if(b>=a && b>=c) { if (b< a+c){ cout << "yes" ; } else { cout << "no" ; } } else if(a>=b && a>=c){ if (a< c+b){ cout << "yes" ; } else { cout << "no" ; } } } */ /* #include <stdio.h> int main (){ int a,i; scanf("%d",&a); for (i = 0;i<a;i++) { printf("*"); } return 0; } */ /* #include <stdio.h> int main (){ int a,i; scanf("%d",&a); for (i = 1;i<10;i++) { printf("%d*%d=%d",a,i,a*i); printf("\n"); } return 0; } */ /* #include <stdio.h> int main (){ int a; int max=-1000000; int min = 1000000; for (int i = 0;i<5 ;i++) { scanf("%d ",&a); if (a>max) { max= a; } if (a<min) { min = a; } } printf("%d \n %d", max, min ); return 0; } */ /* #include <stdio.h> int main (){ int n,i; scanf("%d",&n); for( i = 1;i<=n;i++) { if (n%i==0 ) { printf("not prime"); } else { printf("prime"); } } return 0; } */ /* #include <stdio.h> int main (){ int n,i; scanf("%d",&n); for( i = 2;i<n;i++) { if (n%i==0) { printf("not prime"); return 0 ; } } printf("prime"); return 0; } */ /* #include <stdio.h> int main (){ int a,b,i,sum = 0; scanf("%d %d",&a, &b); for( i = a;i<=b;i++) { if (i%2==0) { sum-=i; } else { sum+=i; } } printf("%d",sum); return 0; } */ /* #include <stdio.h> int main (){ int a,b,i,sum = 0; scanf("%d %d",&a, &b); for( i = a;i<=b;i++) { if (i%2==0) { printf("-%d",i); sum-=i; } else { printf("+%d",i); sum+=i; } } printf("=%d",sum); return 0; } */ /* #include <stdio.h> int main (){ int a,b,i,sum = 0; scanf("%d %d",&a, &b); for( i = a;i<=b;i++) { if (i%2==0) { printf("-%d",i); sum-=i; } else { if (a=i) { printf("%d",i); } else { printf("+%d",i); } sum+=i; } } printf("=%d",sum); return 0; } */
0
0
1
dlatjdus222
2021년 7월 08일
In 소스 코드 제출
//* #include <stdio.h> #include <stdlib.h> int main() { char x,y; scanf("%c %c",&x,&y); printf("%c %c",y,x); return 0; } */ /* #include <stdio.h> #include <stdlib.h> int main() { float a; scanf("%f",&a); printf("%.2f",a); return 0; } */ /* #include <stdio.h> #include <stdlib.h> int main() { int a; scanf("%d",&a); printf("%d %d %d",a,a,a); return 0; } */ /* #include <stdio.h> #include <stdlib.h> int main() { int h,m; scanf("%d:%d",&h,&m); printf("%d:%d",h,m); return 0; } */ /* #include <stdio.h> #include <stdlib.h> int main() { int y,m,d; scanf("%d.%d.%d",&y,&m,&d); printf("%04d.%02d.%02d",y,m,d); return 0; } */ /* #include <stdio.h> int main() { int a,b; scanf("%d-%d",&a,&b); printf("%06d%07d",a,b); return 0; } */ /* #include <stdio.h> int main() { char a; scanf("%c",); printf("%c",); return 0; } */ /* int 4Byte -21억 ~ +21억 long long int 8Byte + - * / % long long int %lld int a, b; scanf("%d %d",&a,&b); printf("%lld",(long long int)a+b); */ /* #include <stdio.h> int main() { int a,b; scanf("%d %d", &a,&b); printf("%lld",(long long int)a+b); return 0; } */ /* #include <stdio.h> int main() { long long int a,b; scanf("%lld %lld", &a,&b); printf("%lld",a+b); return 0; } */ /* #include <stdio.h> int main() { int a; scanf("%d",&a); printf("%d",-a); return 0 ; } char a; scanf("%c",&a); printf("%c",a+1); return 0; 5/2 2 5%2 1 5/2 2.5 (float)a/b #include <stdio.h> int main() { int a,b; scanf("%d %d", &a,&b); printf("%d",a/b); return 0; } #include <stdio.h> int main() { int a,b; scanf("%d %d", &a,&b); printf("%d",a%b); return 0; } #include <stdio.h> int main() { int a,b; scanf("%d %d", &a,&b); printf("%d\n",a+b); printf("%d\n",a-b); printf("%d\n",a*b); printf("%d\n",a/b); printf("%d\n",a%b); printf("%.2f",(float)a/b); return 0; } #include <stdio.h> int main() { int a,b,c; scanf("%d %d %d", &a,&b,&c); printf("%d\n",a+b+c); printf("%.1f",(float)(a+b+c)/3); return 0; } #include <stdio.h> int main() { int a,b; scanf("%d %d", &a,&b); printf("%d",a>b); return 0; } #include <stdio.h> int main() { int a,b; scanf("%d %d", &a,&b); printf("%d",a==b); return 0; } #include <stdio.h> int main() { int a,b; scanf("%d %d", &a,&b); printf("%d",a<=b); return 0; } */ /* #include <stdio.h> int main() { int a,b; scanf("%d %d", &a,&b); printf("%d",a!=b); return 0; } 1 true : 0이 아닌 모든 수 0 false not ! and && or || #include <stdio.h> int main() { int a; scanf("%d",&a); printf("%d",!a); return 0; } #include <stdio.h> int main() { int a,b; scanf("%d %d",&a,&b); printf("%d",a&&b); return 0; } #include <stdio.h> int main() { int a,b; scanf("%d %d",&a,&b); printf("%d",a||b); return 0; } #include <stdio.h> int main() { int a,b; scanf("%d %d",&a,&b); printf("%d",(a&&!b)||(!a&&b)); return 0; } int main() { int a,b; scanf("%d %d",&a,&b); printf("%d",(!a&&!b)||(a&&b)); return 0; } #include <stdio.h> int main() { int a,b; scanf("%d %d",&a,&b); printf("%d",(!a&&!b)||!(a||b)); return 0; } #include <stdio.h> int main() { int a,b; scanf("%d %d",&a,&b); printf("%d",a>b?a:b); return 0; } #include <stdio.h> int main() { int a,b,c; scanf("%d %d %d",&a,&b,&c); printf("%d",(a>b?b:a)>c?c:(a>b?b:a)); return 0; } #include <stdio.h> int main() { int a,b,c; scanf("%d %d %d",&a,&b,&c); printf("%d",(a>b?b:a)>c?c:(a>b?b:a)); return 0; } if() { } else if() { } else if() { } else { } #include <stdio.h> int main() { int a; scanf("%d",&a); if(a<10){ printf("small"); } return 0; } #include <stdio.h> int main() { int a; scanf("%d",&a); if(a<10){ printf("small"); } else{ printf("big") } return 0; } #include <stdio.h> int main() { int a,b; scanf("%d %d",&a,&b); if(a<b){ printf("<"); } else if(a>b) { printf(">"); } else{ printf("="); } return 0; } #include <stdio.h> int main() { int a,b; scanf("%d %d",&a,&b); if(a<b){ printf("%d",b-a); } else{ printf("%d",a-b); } return 0; } #include <stdio.h> int main() { int a; scanf("%d",&a); if(a%7==0){ printf("multiple"); } else{ printf("not multiple"); } return 0; } #include <stdio.h> int main() { int a; scanf("%d",&a); if(a%2==0){ printf("even"); } else{ printf("odd"); } return 0; } #include <stdio.h> int main() { float a; scanf("%f",&a); if(50<=a&&a<=60){ printf("win"); } else{ printf("lose"); } return 0; } #include <stdio.h> int main() { int a; scanf("%d",&a); if((60<=a&&a<=70)||(30<=a&&a<=40)){ printf("win"); } else{ printf("lose"); } return 0; } #include <stdio.h> int main() { int a; scanf("%d",&a); if((50<=a&&a<=70)||(a%6==0)){ printf("win"); } else{ printf("lose"); } return 0; } #include <stdio.h> int main() { int a; scanf("%d",&a); if(a==1||a==3||a==5||a==7){ printf("oh my god"); } else{ printf("enjoy"); } return 0; } #include <stdio.h> int main() { int a,b; scanf("%d %d",&a,&b); if(a%2==0){ if(b%2!=0){ printf("짝수+홀수=홀수"); } else{ printf("짝수+짝수=짝수"); } } else if(a%2!=0){ if(b%2==0){ printf("홀수+짝수=홀수"); } else { printf("홀수+홀수=짝수"); } } return 0; } #include <stdio.h> int main() { int a,b,c; scanf("%d %d %d",&a,&b,&c); if((a-b+c)%10==0) { printf("대박"); } else { printf("그럭저럭"); } return 0; } #include <stdio.h> int main() { int a,b,c,d; scanf("%d %d %d",&a,&b,&c); d= ((a+b+c)/100); if(d%2==0) { printf("대박"); } else { printf("그럭저럭"); } return 0; } #include <stdio.h> int main() { int a,b,c; scanf("%d %d %d",&a,&b,&c); if(a>170&&b>170&&c>170) { printf("PASS"); } else { printf("CRASH"); } return 0; } #include <stdio.h> int main() { int a,b; scanf("%d %d",&a,&b); if((90-a)%5==0) { printf("%d",(90-a)/5+b); } else { printf("%d",(90-a)/5+1+b); } return 0; } #include <stdio.h> int main() { int a; scanf("%d",&a); if((a%400==0)||(a%4==0 && a%100!=0)) { printf("yes"); } else { printf("no"); } return 0; } */
0
0
1
dlatjdus222
2021년 7월 04일
In 소스 코드 제출
#include <iostream> #include <string> using namespace std; int top=0; int arr[100000]; void input(int tmp){ arr[top++]= tmp; } void output(){ top--; arr[top]=0; for(;;){ top--; cout <<arr[top]; } } int main(){ string a; string b; cin >> a >> b; int c=0,tmp; int lena = a.length()-1; int lenb = b.length()-1; while(true) { if(lenb==0) { tmp=a.at(lena--)-'0'+c; } else if(lena==0) { tmp=b.at(lenb--)-'0'+c; } else { tmp=a.at(lena--)+b.at(lenb--)-'0'*2+c; } input(tmp%10); c=tmp/10; if(lena==0&&lenb==0) { break; } } if(c==1) { input(1); } output(); }
0
0
1
dlatjdus222
2021년 6월 26일
In 소스 코드 제출
#include <stdio.h> #include <stdlib.h> /* int main() { printf("Hello world!\n"); return 0; } */ /* #include<stdio.h> int main() { int a, b; scanf("%d %d",&a, &b); if(b==1||b==2){ printf("%d",2013-(a/10000+1900)); } else if(b==3||b==4){ printf("%d",2013-(a/10000+2000)); } */ #include<stdio.h> int main() { int a, b; scanf("%d",&a); b = 2013-a; if(b==1){ printf("%d",1900); } else if(b==3){ printf("%d",2000); } }
0
0
1
dlatjdus222
2021년 6월 24일
In 소스 코드 제출
/* #include <iostream> using namespace std; int main(){ int n; cin >> n; for(;;) { cout << n%10; n/=10; if(n==0) break; } return 0; } */ /* n = int(input()) k = int(input()) b = [] for i in range(n): a = k%10 a= int(a) b.append(a) k=k-a k/=10 if n==0: break for i in range(n): if i%3==0: b.insert(i,',') for i in range(n): if b[0]==',': b.remove(',') print(b[i]) else: print(b[i]) */ /* #include <iostream> using namespace std; int top; int arr[100000]; int num; //천단위 3자리씩 나눠서 콤마 넣어주기 void input(char a){ arr[top++]=a; for (int i=0;;i++){ if (i%3==0){ i=45; } } } void output(){ top--; arr[top]= 0; if(','==arr[top]){ return; } else{ cout<<('%c',arr[top]); } } int main(){ top = 0; int n, k, a; cin >> n; cin >>k; for (;;){ a = k%10+48; a= int a; input(a); k=k-a k/=10; if (n==0){ break; } } return 0; } */
0
0
3
dlatjdus222
2021년 6월 23일
In 소스 코드 제출
/* #include <iostream> #define MAXSIZE 5 using namespace std; int arr[MAXSIZE]; int top; void input(); void output(); void view(); void input(int k){ if(top==MAXSIZE) { cout << "stack is full"; return; } arr[top++] = k; } void output(){ if(top==0) { cout << "stack is empty"; return; } top--; cout << "output data is " << arr[top] << "deth"; arr[top] = 0; } void view(){ for(int i=0; i<MAXSIZE; i++) { cout << i << ":" << arr[i] << "\n"; } } int main(){ top = 0; int n, k, i; for(;;) { cout << "1:push, 2:pop, 3:view\n"; cin >> n; switch(n) { case 1: cout << "input data : "; cin >> k; input(k); break; case 2: output(); break; case 3: view(); break; } } } */ /* #include <iostream> using namespace std; int top; int n; int arr[1000000]; void input(int k){ arr[top++] = k; } void output(){ top--; arr[top] = 0; } int main(){ top = 0; int k; cin >> n; int sum; sum = 0; for(int i=0;i<n;i++) { cin >> k; if (k==0){ output(); } else{ input(k); } } for(int i=0; i<top; i++) { sum += arr[i]; } cout << sum; } */ /* #include <iostream> using namespace std; int top; int n; int arr[1000000]; void input(int k){ arr[top++] = k; } void output(){ top--; cout << arr[top]; arr[top] = 0; } int main(){ top = 0; int k; cin >> n; for(int i=0;i<n;i++) { cin >> k; input(k); } for (;top;){ output(); } return 0; } */
0
0
3

dlatjdus222

더보기
bottom of page