[정올] 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;
}