top of page

소스 코드 제출

공개·회원 69명

20250701

#include <stdio.h>

#include <stdlib.h>

// 10 9 8 7 6 5 4 3 2 1


int main() {

int arr[9999] ={0}, v=0, n,k;

int cnt = 0, temp,i, nowIndex=0;

scanf("%d", &n);

temp = n;

i=0;

while (temp!=0) {

arr[i] = temp%10;

temp/=10;

cnt++;

i++;

}

for (i=n-1; i>0; i--) {

nowIndex = 0;

v=0;

for (int j=0; j<=cnt; j++) {

v += arr[nowIndex] * i;

if (v>=10) {

arr[nowIndex] = v%10;

v = v/10;

}

else {

arr[nowIndex] = v;

v=0;

}

nowIndex++;

}


arr[nowIndex] = v;


if (v>0) {

cnt++;

}

}

k=0;

while ((int)arr[k]==0) {

k++;

}

if (n==0) {

printf("0");

}

else {

printf("%d",k);

}

return 0;

}

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