怎么使用Java的for循环打印出下面的图案? 50
1个回答
2016-01-07
展开全部
#include<unistd.h>
#include<stdio.h>
int main()
{
pid_t pid;
pid = fork();
sleep(5);
if(pid > 0)
{
printf("PID: %d -> Father Process is running \n",getpid());
}
else if(pid == 0)
{
printf("PID: %d -> Son Process is running \n",getpid());
}
else
{
printf("Create process failed \n");
return 1;
}
return 0;
}
#include<stdio.h>
int main()
{
pid_t pid;
pid = fork();
sleep(5);
if(pid > 0)
{
printf("PID: %d -> Father Process is running \n",getpid());
}
else if(pid == 0)
{
printf("PID: %d -> Son Process is running \n",getpid());
}
else
{
printf("Create process failed \n");
return 1;
}
return 0;
}
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询