SW Expert Academy
(SWEA c++)6718. 희성이의 원근법
naeunchan
2020. 11. 19. 10:04
728x90
반응형
SW Expert Academy
SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요!
swexpertacademy.com
#include <cstdio>
using namespace std;
int main(void)
{
int t;
scanf("%d", &t);
for(int tc = 1; tc <= t; tc++)
{
int d, ans = 0;
scanf("%d", &d);
if(d < 100)
ans = 0;
else if(d < 1000)
ans = 1;
else if(d < 10000)
ans = 2;
else if(d < 100000)
ans = 3;
else if(d < 1000000)
ans = 4;
else
ans = 5;
printf("#%d %d\n", tc, ans);
}
return 0;
}
728x90
반응형