참고 :https://www.nayuki.io/page/project-euler-solutionshttps://projecteuler.net/problem=1 # Python 3 total: int = 0 for i in range(1, 1000): if i % 3 == 0 or i % 5 == 0: total += i print("total =", total) # Python 3 print(sum([i for i in range(1, 1000) if i % 3 == 0 or i % 5 == 0])) // C/C++ #include #include #include #include int _tmain(INT32 argc, LPTSTR argv[]) { INT32 total = 0; for (INT32 i ..
import sys # virtualenv if hasattr(sys, 'real_prefix') \ and hasattr(sys, 'base_prefix') \ and hasattr(sys, 'prefix') \ and sys.base_prefix == sys.prefix: print("in virtualenv environment") print("sys.real_prefix", sys.real_prefix) print("sys.base_prefix", sys.base_prefix) print("sys.prefix ", sys.prefix) # venv if not hasattr(sys, 'real_prefix') \ and hasattr(sys, 'base_prefix') \ and hasattr(s..
unsafe keyword를 사용하면 , C/C++에서 사용하는 pointer를 C#에서도 사용할 수 있다. unsafe keyword를 사용하기 위해서 compile할 때 /unsafe option을 주어야한다. compile할 때 /unsafe option을 주려면 Visual Studio에서 아래와 같이 설정해주면 된다. 참고 : /unsafe (C# Compiler Options) To set /unsafe compiler option in the Visual Studio development environmentOpen the project's Properties page. Click the Build property page. Select the Allow Unsafe Code check bo..