[정올] Language Coder_반복제어문3_자가진단1_code549 (C)
두비니
·2020. 4. 1. 16:44
#include <stdio.h>
int main() {
int n, sum=0,cnt=0;
scanf("%d", &n);
for (int i = 1; sum < n; i += 2) {
sum += i;
cnt++;
}
printf("%d %d", cnt, sum);
return 0;
}
'Coding_Algorithm > 정올 문제풀이' 카테고리의 다른 글
[정올] Language Coder_반복제어문3_자가진단3_code550 (C) (0) | 2020.04.03 |
---|---|
[정올] Language Coder_반복제어문3_자가진단2_code634 (C) (0) | 2020.04.02 |
[정올] Language Coder_반복제어문2_형성평가A_code139 (C) (0) | 2020.03.31 |
[정올] Language Coder_반복제어문2_형성평가9_code138 (C) (0) | 2020.03.30 |
[정올] Language Coder_반복제어문2_형성평가8_code137 (C) (0) | 2020.03.29 |