반복문 - 반복문 활용 예제12(규칙숫자 찾기1)

2018. 7. 8. 11:18algorithm/dimigo.goorm.io

#include <stdio.h>


int main() {

int num;

int solve = -3;

int i;

scanf("%d", &num);

for (i = 1; i <= num; i++) {

solve = solve + 4;

}

printf("%d", solve);

}