top of page

소스 코드 제출

공개·회원 50명

20250824

/*

#include <stdio.h>

int memo[1000001][26]={};

int f(int i,int j)

{

if(memo[i][j]!=0)

{

return memo[i][j];

}

if(j==1)

{

return i;

}

else if(i==f)

{

return 1;

}

else if(i<j)

{

return 0;

}


return memo[i][j]=f(i-1,j-1)+f(i-1,j);

}

int main()

{

int a,b;

scanf("%d %d",&a,&b);

printf("%d",f(a,b));

return 0;

}

c언어(완) -> c 자료구조 (스택, 큐, 정렬, 이분탐색, dfs/bfs)

python -> py자료구조 -> 프로젝트 제작

c++


-1 // 0 1 2 3 ...


*/

#include <stdio.h>

int stack[1001]={};

int top=-1; // 마지막 데이터의 위치


void push(int x)

{

top++;

stack[top]=x;

}


//void pop()

//{

// printf("%d ",stack[top]);

// top--;

//}

int pop()

{

return stack[top--];

}


int main()

{

int a,b,i,c=0;


scanf("%d",&a);


for(i=1 ; i<=a ; i++)

{

scanf("%d",&b);

push(b);

}

while(top!=-1) // 스택에 뭔가 있다면

{

c=c+pop();

}


printf("%d",c);

}

16회 조회
주소 : 경기도 용인시 광교중앙로 302 블루 스퀘어 602호
연락처 : 031) 216 - 1546 ,     031) 215 - 1546
사업자등록번호 : 465-92-00916
​학원 등록 제 4603호
bottom of page