본문 바로가기

분류 전체보기

(469)
[비주얼베이직|초급] 별찍기 변형 목표는 이거. * *** ***** ******* ********* 이렇게 나오는 소스는 이거. 변수명을 한글로 썼다. 변수명을 보면 어떤 의도인지 알 수 있을 것이다. Module Module1 Sub Main() Dim 줄수 As Integer Dim 칸수 As Integer Dim 줄수최대값 As Integer Dim 갯수 As Integer 줄수최대값 = 5 For 줄수 = 1 To 줄수최대값 Dim 빈칸수 As Integer 빈칸수 = 줄수최대값 - 줄수 + 1 For 칸수 = 1 To 빈칸수 Console.Write(" ") Next Dim 별갯수 As Integer 별갯수 = 2 * 줄수 - 1 For 갯수 = 1 To 별갯수 Console.Write("*") Next Console.Writ..
[Py|초급] 달팽이 이차원배열, 나머지연산과 논리연산 #!/usr/bin/env python # Daum sinjisik # Author : DwYoon ################################################################## print "---------------------" for i in xrange(12): for j in xrange(12): print (((i+2)/2)%2)^(((j)/2)%2), print ################################################################## print "---------------------" for i in xrange(12): for j in xrange(12): print (((i+3)/3)%2)^(((j)..
[C#|초급] 성적입력 및 출력 using System; using System.IO; namespace 점수 { class Program { private static string[] 이름 = new string[30]; private static int[,] 점수 = new int[30,5]; private static string[] 학점 = new string[30]; private static string[] 성적구분 = { "중간", "기말", "과제물", "출석" }; private static TextReader 콘솔입력 = Console.In; private static TextWriter 콘솔출력 = Console.Out; //############### //# 여기가 시작 # //############### stat..
[C|MFC] 푸리에 시리즈 사각파 사각파 푸리에 시리즈 python 버전은 : https://daewonyoon.tistory.com/258 조금 지져분한 콘솔버전 /* By 숙제도둑 */ #include #define PI 3.1415927 /* * 1 * F (t) = ------- sin ( (2n+1) t ) * n 2n + 1 * */ double f(int n, double t) { return sin((2*n+1)*t)/(2*n+1); } /* * * k * X (t) = Sigma F (t) * k n = 1 n * */ double X(int k, double t) { int n; double sum = 0.0; for(n=0; n
C# 예제 : 클래스 http://blog.mag2.com/m/log/0000141533/ 에 빚지고 있는 글입니다. C#을 모르는 상태에서 시험적으로 한글 변수명, 메소드명을 사용했기 때문에 표준적인 C# 코딩 컨벤션과 다를 수 있습니다. using System; namespace 날짜클래스 { class 윤날짜 { public int 해; public int 달; public int 날; } class Program { static void Main(string[] args) { 윤날짜 날짜 = new 윤날짜(); 날짜.해 = 2007; 날짜.달 = 4; 날짜.날 = 7; 날짜찍기(날짜); } private static void 날짜찍기(윤날짜 날짜) { Console.WriteLine("{0}년 {1}월 {2}일", 날..