#include<iostream>
#include<string.h>
using namespace std;
double c[10];
double DP(int d) {
if (d == 10) return 1;
double& ret = c[d];
if (ret != -1) return ret;
ret = 0.0;
ret += DP(d + 1) * 0.1;
return ret;
}
int main() {
memset(c, -1, sizeof(c));
cout << DP(0) << "\n";
}

크기 차이로 조절하여 다음과 같은 코드로 변경하여 문제를 해결할 수 있다
#include<stdio.h>
#include<string.h>
using namespace std;
double c[10];
double DP(int d) {
if (d == 10) return 1;
double& ret = c[d];
if (ret > -1) return ret;
ret = 0.0;
ret += DP(d + 1) * 0.1;
return ret;
}
int main() {
memset(c, -1, sizeof(c));
printf("%.10lf", DP(0));
}

#include<iostream>
using namespace std;
int c = 1
if(c){
cout << "True" << "\n";
}
else{
cout << "False" << "\n";
}
True가 출력될까 False가 출력될까?
답은 True이다 c가 0 이 아니면 모두 True가 나옴을 기억하자
int c = (조건, 비교연산자) ? (True일 땐 이거) : (False일 땐 이거)
int a = 1;
int c = (a == 1) ? 1 : 0;
cout << c << "\n";