您当前的位置: 首页 >  Python

python调用外部可执行文件的三种方法

FPGA硅农 发布时间:2020-11-06 18:55:50 ,浏览量:4

首先用c语言编写一个简单的计算阶乘的程序,代码如下:

#include
int main(int argc,char *argv[]){
    //计算n的阶乘
    int i=0,j;
    int sum=0;
    int base=0;
    int product=1;
    char* str=argv[1];
    if(argc!=2)
        printf("argument is not right\n\r");
    printf("%s\n\r",str);
    while(str[i++]!='\0');
    //n是i位数
    base=1;
    for(j=0;j            
关注
打赏
1688896170
查看更多评论
0.0536s