본문 바로가기

PROGRAM

(92)
입력한숫자만큼 별 출력하기(4자리수 한정) 입력한 숫자만큼의 별모양을 출력하는 프로그램을 작성하여보자 예를 들어 5914를 입력하면 별이 5, 9 , 1, 4 개가 출력되는 프로그램이다. #include using namespace std; int main() { int num; cout num; while(1){ if( (num >= 1000) && (num
iris.csv 분석 In [65]: %matplotlib inline import seaborn as sns import pandas as pd import numpy as np import matplotlib.pyplot as plt In [17]: df = pd.read_csv("iris.csv") df.info() RangeIndex: 150 entries, 0 to 149 Data columns (total 5 columns): # Column Non-Null Count Dtype --- ------ -------------- ----- 0 sepal_length 150 non-null float64 1 sepal_width 150 non-null float64 2 petal_length 150 non-null fl..
jupyter notebook을 tistory에 적용하기 https://jfun.tistory.com/42 Jupyter Notebook에서 처리한 작업을 Tistory로 손쉽게 가져오기 주피터 노트북에서 작업한 내용을 깔끔하게 티스토리에 정리하는 노하우를 공개하겠다. (1) 주피터 노트북에서 File 탭에서 Print Preview를 누른다. (2) 새로운 창이 열리면서 주피터에서 작업한 내� jfun.tistory.com https://versusall.tistory.com/entry/1-Tistory-%EA%B8%80%EC%93%B0%EA%B8%B0-tip Jupyter Notebook 1. Tistory 글쓰기 tip Jupyter Notebook 1. Tistory 글쓰기 tip # Jupyter Notebook 1. Tistory 글쓰기 tip¶ 1..
Thread TimerEx import java.awt.*; import javax.swing.*; class TimerThread extends Thread { private JLabel timerLabel; // 타이머 값이 출력되는 레이블 public TimerThread(JLabel timerLabel) { this.timerLabel = timerLabel; } // 스레드 코드. run()이 종료하면 스레드 종료 @Override public void run() { int n=0; // 타이머 카운트 값 while(true) { // 무한 루프 timerLabel.setText(Integer.toString(n)); n++; // 카운트 증가 try { Thread.sleep(1000); // 1초동안 잠을 잔다. } ..
구구단 가로로 출력 + 제외할 단 입력 구구단을 출력하는데 입력받은 단은 제외하는 프로그램 /****************************************************************************** Welcome to GDB Online. GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl, C#, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog. Code, Compile, Run and Debug online from anywhere in world. *****************..
pyQt5 + cv2.findContours 이미지를 로드하였을때 src가 gray인지 칼라인지 확인하고 gray이면 칼라로 변환해야할 경우 src = self.imread(self.filename) if src.shape[2] is None: # null check src = cv2.merge((src, src, src)) cv2.findContours 함수가 OpenCV4.3에서 달라졌음 앞에 _,를 추가해야 함 _, contours, hierachy = cv2.findContours(binary, cv2.RETR_CCOMP, cv2.CHAIN_APPROX_NONE)
인터페이스 interface Animal { public void animalSound(); // interface method (does not have a body) public void sleep(); // interface method (does not have a body) } class Pig implements Animal { public void animalSound() { System.out.println("The pig says: wee wee"); } public void sleep() { System.out.println("Zzz"); } } class MyMainClass { public static void main(String[] args) { Pig myPig = new Pig(); m..
추상클래스 // 추상클래스(Abstract class) abstract class Animal { // Abstract method (does not have a body) public abstract void animalSound(); // Regular method public void sleep() { System.out.println("Zzz"); } } // Subclass (inherit from Animal) class Pig extends Animal { public void animalSound() { // The body of animalSound() is provided here System.out.println("The pig says: wee wee"); } } class MyMainClas..