본문 바로가기

전체 글

(195)
CH03. 데이터 일괄처리 1.학생의 최종점수 계산하기 1) 이름을 입력합니다. 2) 중간, 기말 시험 점수를 공백으로 분리하여 입력합니다.(실수형으로 입력가능합니다.) 3) 과제 점수를 입력하고 마지막에 EOF를 입력합니다.(과제의 개수는 몇 개든 상관 없습니다.) 4) 과제 점수의 평균을 구합니다. 5) 중간시험(20%), 기말시험(40%), 과제(40%)의 가중치를 가집니다. 6) 데이터는 소수점 3자리까지의 정확성을 가집니다. #include // 입출력 라이브러리에서 전송된 문자수나 버퍼크기를 나타내기 위해 사용 #include #include #include using namespace std; int main() { // 학생의 이름을 묻고 입력받음 cout > name; cout x) { ++count; sum +=..
Hello Johns! 출력하기 1. 아래 그림과 같이 사용자의 이름을 입력받아 입력받은 이름 앞에 Hello와 이름뒤에 !를 붙여 출력하고 이름 위 아래에 별을 출력하는 프로그램을 작성하여 보자 #include #include using namespace std; int main() { string name; cout > name; const string greeting = "Hello " + name + "!"; const string spaces(greeting.size(), ' '); const string blanks = "* " + spaces + " *"; const string stars(blanks.size(), '*'); cout
입력한숫자만큼 별 출력하기(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)