KakaoTalk_20190606_001802318.png
  • 246x0w
Welcome
Curriculum
Install&Go
Board
실제 작동 상태를 확인하려면 라이브 사이트로 이동하세요.
  • 카테고리
  • 전체 게시물
  • 내 게시물
minjukim3p
2020년 6월 18일

200618

게시판: 소스 코드 제출

/*

#include <stdio.h>

#include <stdlib.h>


int main()

{

printf("Hello world!\n");

return 0;

}

*/

/*

#include <stdio.h>

#define size 35

int stack[size];

int top;

int isfull()

{

if(top==size-1){

return 1;

}

else{

return 0;

}

}

int isempty()

{

if(top==-1){

return 1;

}

else{

return 0;

}

}

void init()

{

top=-1;

}

void push(int data)

{

if(isfull()){

printf("stack is full\n");

return 0;

}

top++;

stack[top]=data;

}

int pop()

{

int k;

if(isempty())

{

printf("stack is empty\n");

return 0;

}

k=stack[top];

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

stack[top]=0;

top--;

return k;

}

void view()

{

int i;

printf("==========\n");

for(i=0;i<=top;i++){

printf("%d ",stack[i]);

}

printf("\n==========\n");

}


int main()

{

int i,data;

char str[35];

init();

scanf("%s",str);

for(i=0;i<strlen(str);i++){

push(str[i]-48);

}

for(i=0;i<strlen(str);i++){

printf("%d",pop());

}


}

*/

/*

#include <stdio.h>

#define size 100000

int stack[size];

int top;

int isfull()

{

if(size-1==top){

return 1;

}

else{

return 0;

}

}

int isempty()

{

if(top==-1){

return 1;

}

else{

return 0;

}

}

void init()

{

top=-1;

}

void push(int data)

{

if(isfull()){

// printf("stack is full\n");

return 0;

}

top++;

stack[top]=data;

}

int pop()

{

int k;

if(isempty()){

// printf("stack is empty\n");

return 0;

}

k=stack[top];

stack[top]=0;

top--;

return k;

}

void view()

{

int i;

printf("===========\n");

for(i=0;i<=top;i++){

printf("%d ",stack[i]);

}

printf("\n===========\n");

}

int main()

{

int i,n,m,sum=0,data;

init();

scanf("%d",&n);

for(i=0;i<n;i++){

scanf("%d",&m);

if(m==0){

pop();


}

else{

push(m);


}

}

for(i=0;i<=top;i++){

sum+=stack[i];

}

printf("%d",sum);

return 0;

}

*/

/*

#include <stdio.h>

#define size 100000000

int stack[size];

int top;

int isfull()

{

if(size-1==top){

return 1;

}

else{

return 0;

}

}

int isempty()

{

if(top==-1){

return 1;

}

else{

return 0;

}

}

void init()

{

top=-1;

}

void push(int data)

{

if(isfull()){

return 0;

}

top++;

stack[top]=data;

}

int pop()

{

int k;

if(isempty()){

return 0;

}

k=stack[top];

stack[top]=0;

top--;

return k;

}

int main()

{

int data,i;

char str[1000],str1[1000];

init();

scanf("%s %s",str,str1);

for(i=0;i<strlen(str);i++){

}

}

*/


댓글 0개
0
댓글
댓글 0개
유사 게시물
  • 200618
  • 200618
  • 200618
주소 : 경기도 용인시 광교중앙로 302 블루 스퀘어 602호
연락처 : 031) 216 - 1546
사업자등록번호 : 465-92-00916
​학원 등록 제 4603호