목록Programming Language (136)
091
🔍C#: CS_505.주어진 파일인 read.txt에서 13줄 중에 사용자가 입력한 조건에 부합하는 줄의 이름과 총합 값을 출력하시오. 1. 문제 정답using System;using System.IO;using System.Linq;using System.Collections.Generic;namespace CS_505{ class CS_505{ static string filePath = "read.txt"; static void Main(){ try{ List list = new List(); string[] input = Console.ReadLine().Split(' '); ..
🔍C#: CS_504.입력 받은 점수들을 파일에 저장하고 출력하시오. 만약 점수에 맞지 않는 값이 들어온 경우에는 error를 출력하시오. 1. 문제 정답using System;using System.IO;using System.Linq;namespace CS_503{ class CS_503{ static string filePath = "write.txt"; static string[] new_student = { "Sam", "1981/10/1", "A234567890" }; static void Main(){ try{ int[] scores = Console.ReadLine() ..
🔍C#: CS_503.주어진 배열 data는 총 6줄로 구성되어있고, 입력받은 숫자의 해당하는 줄까지 write.txt에 저장하시오. 배열 크기 이상의 값이 들어온 경우 error를 출력하시오. 1. 문제 정답using System;using System.IO;namespace CS_503{ class CS_503{ static string filePath = "write.txt"; static string[] data = {"Life is difficult, life is unfair, life is challenging and sometimes painful. And life is so very good." , "There are frustrations, ..
🔍C#: CS_502 .입력받은 문자열을 write.txt 파일에 작성하고 매번 덮어쓰게 만드시오. 만약 아무것도 입력하지 않은 경우에는 error를 출력하시오. 1. 문제 정답using System;using System.IO;namespace CS_502{ class CS_502{ static string filePath = "write.txt"; static void Main(){ try{ string input = Console.ReadLine() ?? ""; if(input == "") throw new Exception(); using(StreamWriter wr..
🔍C#: CS_501 .주어진 파일인 read.txt에서 10줄 중 사용자가 입력한 값을 출력하시오. 이외의 문자나 출력할 수 없는 줄의 숫자를 입력한 경우 error를 출력하시오. 1. 문제 정답using System;using System.IO;namespace CS_501{ class CS_501{ static string filePath = "read.txt"; static void Main(){ try{ int input = int.Parse(Console.ReadLine()); if(input >= 11 || input 2. 정리- 파일을 읽을 때는 StreamReader 인스턴스를 만들..
01. 위치- position 속성의 경우, 기본값이 static으로 문서 흐름대로 배치하며, top,bottom 같은 요소의 위치를 조절하는 속성들이 작동하지 않습니다. top,right,bottom,left은 속성값으로 크기를 지정하면 됩니다.속성 값의미 및 설명static기본값. 문서 흐름대로 배치됨relative현재 위치 기준으로 조금 이동 가능absolute가장 가까운 position이 설정된 조상 기준으로 절대 위치로 지정fixed브라우저 창 기준으로 고정(스크롤해도 움직이지 않음)sticky스크롤에 따라 relative->fixed처럼 동작함(특정 위치에 고정됨) - z-index는 요소의 쌓임을 지정하는 속성으로 속성값으로 숫자를 작성합니다. 숫자가 클수록 앞에 표시됩니다. relative..
01. Stream API(Application Programming Interface) - Stream API : 컬렉션(List, Set, Map 등) 또는 배열의 데이터를 함수형 스타일로 처리할 수 있도록 도와주는 API*API : 다른 코드/시스템과 통신하거나 기능을 사용할 수 있게 해주는 인터페이스로, 기능의 집합 - 흐름 구조: Stream 생성 -> 중간연산 -> 최종연산1️⃣ 스트림 생성//컬렉션의 경우 인스턴스.stream()으로 작성하여 스트림을 생성List list = new ArrayList();list.stream();//배열의 경우 Arrays.stream(배열 식별자)으로 작성하여 스트림을 생성String[] arr = new String[5];Arrays.stream(arr)..
🔍C#: CS_410 .입력받은 월에 해당하는 생일자가 배열에 몇 명 있는지 출력하시오. 없다면 0을, 입력값이 이상하면 error를 출력하시오. 1. 문제 정답using System;namespace CS_410{ class CS_410{ static string[] birthday = { "1980/1/11", "1985/3/2", "1985/12/3","1986/6/3","1986/11/14","1987/2/2","1987/8/1","1987/10/12","1987/9/3","1987/8/1","1987/4/12","1988/1/3","1987/5/6","1987/6/7","1987/8/19","1987/6/13","1987/10/9","1986/4/8","1987/5/15","..