"카타 8급 You Can't Code Under Pressure #1"의 두 판 사이의 차이

5번째 줄: 5번째 줄:


==C==
==C==
[[분류:카타 8급 C]]
{{카타|8급|C|2}}
<source lang='c'>
<source lang='c'>
#include <stdint.h>
#include <stdint.h>

2019년 2월 14일 (목) 01:30 판

1 개요

카타 8급 C
# 🔗 문제 풀이

틀:카타 8급-4

2 C

#include <stdint.h>
int32_t double_integer(int32_t n) {
  return n*2;
}
#include <stdint.h>
int32_t double_integer(int32_t n) {
  return n<<1;
}

3 C++

#include <cstdint>
int32_t double_integer(int32_t n) {
  return n*2;
}
#include <cstdint>
int32_t double_integer(int32_t n) {
  return n << 1;
}

4 PHP

function doubleInteger($i) {
  return $i*2;
}