求大神把下面的C语言译成python,拜托了!!!!
#include<time.>#include<stdio.h>#include<stdlib.h>Voidmain(){Intk,num;Srand(time(NULL...
#include<time.>
#include<stdio.h>
#include<stdlib.h>
Void main()
{
Int k,num;
Srand(time(NULL));
Printf(“请输入一个0-99的数:”);
Scanf(“%d”,%num);
K=rand()%100;
If(k==num)
Printf(“Congradulation,you are right!”);
If(k>num)
Printf(“it is too high.”);
Else
Printf(“it is too small.”);
} 展开
#include<stdio.h>
#include<stdlib.h>
Void main()
{
Int k,num;
Srand(time(NULL));
Printf(“请输入一个0-99的数:”);
Scanf(“%d”,%num);
K=rand()%100;
If(k==num)
Printf(“Congradulation,you are right!”);
If(k>num)
Printf(“it is too high.”);
Else
Printf(“it is too small.”);
} 展开
2015-12-07
展开全部
{
struct hashtable * p;
key_t shm_mem_key;
int i;
p = (struct hashtable *) malloc (sizeof(*p));
if (NULL == p)
return NULL;
p->capacity = capacity;
/* initialize the shared memory address space */
shm_mem_key = ftok(path,0);
if (shm_mem_key == -1){
free(p);
perror("ftok error");
return NULL;
}
struct hashtable * p;
key_t shm_mem_key;
int i;
p = (struct hashtable *) malloc (sizeof(*p));
if (NULL == p)
return NULL;
p->capacity = capacity;
/* initialize the shared memory address space */
shm_mem_key = ftok(path,0);
if (shm_mem_key == -1){
free(p);
perror("ftok error");
return NULL;
}
追问
复制粘贴运行不了怎么办
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询