top of page

소스 코드 제출

공개·회원 50명

20250725

/*

#include <stdio.h>

int main()

{

int stack[100000] = {};

int top = 0;

int n,k,m = 0;

scanf("%d",&n);

k=n;

if(n/10==0)

{

printf("%d",n);

return 0;

}

while(1)

{

if(k/10==0)

{

stack[top]=k;

top++;

break;

}

stack[top]=k%10;

k=k/10;

top++;

m++;

}

top=0;

while(1)

{

if(top>m)

{

return 0;

}

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

top++;

}

}

*/



#include <stdio.h>

int main()

{

int stack[100000] = {};

int top = 0;

int n,k,c,m,s; // n: 숫자의 길이,c: 숫자, m: 천단위 구분기호 콤마 여유분 계산, s: 숫자의 복제본.

scanf("%d %d",&n,&c);

s=c; // s 숫자 복제본 생성

printf("\n-----------------\n\n"); ////

while(1)

{

if(s/10==0)

{

stack[top]=s%10;

printf("%d",s%10); ////

printf("\n\n-----------------\n\n"); ////

break;

}

printf("%d",s%10); ////

stack[top]=s%10;

s=s/10;

top++;

}

m=n%3;

if(m!=3)

{

for(int i=0;i<m;i++)

{

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

top++;

}

printf(",");

}


}

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