분류 전체보기
-
백준 4344번 평균은 넘겠지알고리즘 2022. 6. 27. 21:55
https://www.acmicpc.net/problem/4344 4344번: 평균은 넘겠지 대학생 새내기들의 90%는 자신이 반에서 평균은 넘는다고 생각한다. 당신은 그들에게 슬픈 진실을 알려줘야 한다. www.acmicpc.net using namespace std; #include #include int scores[1000]; int main() { int t = 0; int a; int count; int add; cin >> t; cout > a; add = 0; count = 0; for (int x = 0; x > scores[x]; add += scores[x]; } for (int x = 0; x < a; x++) { if (add/a< scores[x])..
-
WPF 시계만들기 (Rotation 사용)C# 2022. 6. 16. 01:41
디자인 Grid를 사용하였고 전과 마찬가지로 시계를 그리기위해 Canvas를 사용하였다. public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); //시계판 그리기 DrawFace(); MakeClockHands(); DispatcherTimer dt=new DispatcherTimer(); dt.Interval = new TimeSpan(0, 0, 0, 0, 10); //0.01초 dt.Tick += Dt_Tick; dt.Start(); } 전과 마찬가지로 DispatcherTimer를 사용하여 시간을 계산하였다. Dt_Tick() private void Dt_Tick(object sender, Even..
-
WPF 시계만들기C# 2022. 6. 16. 00:43
디자인 StackPanel을 틀로 사용해 만들었고 시계를 그려주기위해 Canvas를 사용하였다. Menu를 통해 보기와 옵션을 넣어주었다. Main및 timerSetting() public partial class MainWindow : Window { bool aClock_Flag = true; Point center; double radius; int hourHand; int minHand; int secHand; bool ms_flag = false; DispatcherTimer timer = new DispatcherTimer(); public MainWindow() { InitializeComponent(); aClockSetting(); timerSetting(); } private void ..
-
C# 시계만들기C#/WindowForm 2022. 6. 16. 00:43
디자인은 패널(panel)을 사용하였다. public partial class Form1 : Form { Graphics g; bool aClock_Flag = true; Point center; double radius; int hourHand; int minHand; int secHand; const int clientSize = 300; const int clockSize = 200; //필드, 속성 public Form1() { InitializeComponent(); this.Text = "FormClock"; this.ClientSize = new Size(clientSize, clientSize + menuStrip1.Height); panel1.BackColor = Color.WhiteSm..
-
C# 그래프를 이용한 ECG/PPG 그리기C#/WindowForm 2022. 6. 9. 02:21
시작하기에 앞서 ecg와 ppg의 데이터 파일을 넣어준다. 드래그해서 넣으면 간편히 넣을 수 있다. public partial class Form1 : Form { double[] ecg = new double[100000]; double[] ppg = new double[100000]; private int ecgCount; private int ppgCount; Timer t = new Timer(); public Form1() { InitializeComponent(); this.Text = "ECG/PPG"; this.WindowState = FormWindowState.Maximized; EcgRead(); PpgRead(); ChartSetting(); t.Interval = 10; // 0...
-
C# 그래프 그리기C#/WindowForm 2022. 6. 1. 19:06
Chart를 사용하여 그래프를 그려보자 namespace _041_Graph { public partial class Form1 : Form { public Form1() { InitializeComponent(); this.Text = "Graph using Chart control"; } private void Form1_Load(object sender, EventArgs e) { ChartSetting(); } private void ChartSetting() { ch.ChartAreas[0].BackColor = Color.Black; // X축과 Y축을 설정 ch.ChartAreas[0].AxisX.Minimum = -20; ch.ChartAreas[0].AxisX.Maximum = 20; c..
-
C# Chart 그리기- 2C#/WindowForm 2022. 6. 1. 18:57
1에서 만들어떤것과 마찬가지로 Chart를 사용해서 만들었고 이번에는 합쳐서 그리기와 나누어 그리기 버튼을 추가하였다. private void Form1_Load(object sender, EventArgs e) { chart1.Titles.Add("성적"); chart1.Series.Add("Series2"); chart1.Series["Series1"].LegendText = "수학"; chart1.Series["Series2"].LegendText = "영어"; chart1.ChartAreas.Add("ChartArea2"); chart1.Series["Series2"].ChartArea = "ChartArea2"; Random r = new Random(); for (int i = 0; i < 1..
-
C# Chart그리기-1C#/WindowForm 2022. 6. 1. 18:39
윈폼의 Chart를 사용하여 차트를 만들어보자 namespace _039_Chart { public partial class Form1 : Form { public Form1() { InitializeComponent(); this.Text = "Using Chart Contorl"; } private void Form1_Load(object sender, EventArgs e) { Random r = new Random(); chart1.Titles.Add("중간고사 성적"); for (int i = 0; i < 10; i++) { chart1.Series["Series1"].Points.Add(r.Next(100)); } chart1.Series[0].LegendText = "비주얼프로그래밍"; ch..