-
백준 2292번 C++ 풀이카테고리 없음 2018. 11. 3. 23:35반응형
for 문에 조건을 여러개 붙였습니다..
#include <iostream>
#include <algorithm>
#include <queue>
using namespace std;
int main(){
cin.tie(NULL);
ios::sync_with_stdio(false);
long long n;
cin >> n;
int number = 0;
for (auto i =1, j=0; i< n; j+= 6, i +=j ){
number++;
}
cout << number+1;
return 0;
}반응형