P

@pjs0519

정처기 파이썬 - 뒤집기 함수

Python
1 week ago
def func(lst): for i in range(len(lst) //2): lst[i], lst[-i-1] = lst[-i-1], lst[i] lst = [1,2,3,4,5,6] func(lst) print(sum(lst[::2]) - sum(lst[1::2]))

정처기 파이썬 - 분리함수

Python
1 week ago
#한 번에 2개를 입력받아서 분리문자로 분리해서 각각 다른 변수에 저장하려고 한다. num1, num2 = input().(가)(분리문자)

정처기 파이썬 - 문자열 슬라이싱 및 포매팅

Python
1 week ago
a="REMEMBER NOVEMBER" b=a[:3]+a[12:16] c="R AND %s" % "STR"; print(b+c)

정처기 파이썬 - 기본함수

Python
1 week ago
a={'한국','중국','일본'} a.add('베트남') a.add('중국') a.remove('일본') a.update(['한국','홍콩','태국']) print(a)

정처기 java - static 오버라이딩

Java
1 week ago
public class Main{ public static class Parent { public int x(int i) { return i + 2; } public static String id() { return "P";} } public static class Child extends Parent {

정처기 java - 람다 함수

Java
1 week ago
public class Main { static interface F { int apply(int x) throws Exception; } public static int run(F f) { try { return f.apply(3); } catch (Exception e) {

정처기 java - 배열 주소 복사

Java
1 week ago
public class Main { public static void change(String[] data, String s){ data[0] = s; s = "Z"; } public static void main(String[] args) { String data[] = { "A" }; String s = "B";

정처기 java - T:object

Java
1 week ago
class Main { public static class Collection<T>{ T value; public Collection(T t){ value = t; } public void print(){

정처기 java - Singleton 패턴 + static 변수

Java
1 week ago
// 정답 : 4 class Connection { private static Connection _inst = null; private int count = 0; static public Connection get() { if(_inst == null) { _inst = new Connection(); return _inst;

정처기 java - 주소 및 내용 비교

Java
1 week ago
public class Main { public static void main(String[] args) { String str1 = "Programming"; String str2 = "Programming"; String str3 = new String("Programming"); System.out.println(str1==str2);

정처기 java - 오버라이딩2

Java
1 week ago
class Parent { int x = 100; Parent() { this(500); } Parent(int x) { this.x = x; } int getX() {

정처기 java - 2진수

Java
2 weeks ago
//7번 다음은 변수 n에 저장된 10진수를 2진수로 변환하여 출력하는 java프로그램이다. 프로그램을 분석하여 ( 1번 )( 2번 )빈칸에 알맞은 답을 쓰시오 class Main { public static void main (String[] args) { int[]a = new int[8]; int i=0; int n=10; while ( 1번 ) { a[i++] = ( 2번 );

정처기 java - 오버라이딩

Java
2 weeks ago
class Parent{ void show(){System.out.println("parent");} } class Child extends Parent{ void show() {System.out.println("child");} } class Main { public static void main(String args[]) { Parent pa=(가) Child();

정처기 C언어 - 싱글링크드 리스트

C
2 weeks ago
#include <stdio.h> #include <stdlib.h> struct node { char c; struct node* p; }; struct node* func(char* s) { struct node* h = NULL, *n;

정처기 C언어 - 연결 리스트

C
2 weeks ago
#include <stdlib.h> struct node { int p; struct node* n; }; int main() { struct node a = {1, NULL}; struct node b = {2, NULL};

정처기 C언어 - 구조체

C
2 weeks ago
#include <stdio.h> #define SIZE 3 typedef struct { int a[SIZE]; int front; int rear; } Queue; void enq(Queue* q, int val){

C언어 - 2차원 동적 배열 구조

C
3 weeks ago
#include <stdio.h> #include <stdlib.h> void set(int** arr, int* data, int rows, int cols) { for (int i = 0; i < rows * cols; ++i) { arr[((i + 1) / rows) % rows][(i + 1) % cols] = data[i]; } } int main() {