写在前面
今天在CSDN看到某个算法(约瑟夫生死者游戏)的三种写法,分别是C、C++、Python,我分别实现后产生了一种想法,既然Python被称为胶水语言,那么应该可以把Python移植到C++中执行,说干就干!
三种版本
C语言版(ysfc.cpp),在vs2019中使用cpp后缀
#include<stdio.h>
void ysfc()
{
int i = 1;
int j = 0;
int c = 0;
int a[30] = { 0 };
int b[30] = { 0 };
while (i <= 31)