Skip to content

Instantly share code, notes, and snippets.

@kyagrd
kyagrd / casting.cpp
Last active September 7, 2020 06:05
#include <iostream>
int main()
{
using namespace std;
int64_t x = 0;
// C/C++에서 실수하기 쉬운 부분 단점
x = 3.14592; // 자동으로 형변환되어서 3이 되어버림
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#include <stdio.h>
#include <ctype.h>
#include <stdbool.h>
/* K&R 프로그램에서 시작해서 변형했다면
#define IN 0
// 대문자로 시작한 상태
#define INUP 2
#define OUT 1
#include <stdio.h>
#include <stdbool.h>
size_t strlen(const char* str)
{
size_t n = 0;
while (str[n]) ++n;
return n;
}
#include <stdio.h>
void triR(void)
{ // 이 함수를 완성하시오. (4점)
int size, repeat;
scanf("%d %d", &size, &repeat);
printf("Hello world\n");
for (int k = 0; k < repeat; ++k)
{
@kyagrd
kyagrd / a.dot
Created September 13, 2018 10:03
digraph G {
node [shape=box];
subgraph cluster_1 {
label = "1학년";
color=blue;
이산구조; 프로그래밍실습 -> 고급프로그래밍; 대학수학;
컴퓨터개론 -> 확률통계 [style=invis];
}
@kyagrd
kyagrd / pic.mod
Last active August 19, 2018 20:27
SIGPL2018Summer
module pic. %% file "pic.mod"
% eq X X.
% neq X Y :- eq X Y => fail.
one (inp X P) (dn X Y) (P Y).
one (out X Y P) (up X Y) P.
one (taup P) tau P.
one (par P Q) A (par P1 Q) :- one P A P1.
one (par P Q) A (par P Q1) :- one Q A Q1.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<script id='template' style="text/template">
<p>아래에 생성된 폼은 다음 주소로 요청을 보냅니다.
<pre><%=url%></pre>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style id="jsbin-css">
body {
font-size: calc(var(--font-size) * 1pt);
}
// 콘솔 응용 프로그램 진입점 정의
#include "stdafx.h" // Visual C++에서 자동으로 생성해주는 녀석
int Main(void) // 이걸 메인함수라고 생각하고 프로그래밍하면 됨
{
printf("hello world");
return 0;
}