0
任何人都可以告诉我如何在shell中执行c程序的输入作为命令?在C中执行用户输入作为shell命令C
我试着用下面的代码
#include <stdio.h>
void main()
{
int year,month;
system("date");
printf("Enter the month and year\n");
scanf("%d%d",&month,&year);
system("cal &&");
printf("%d %d",month,year);
system("ls");
system("ps");
}
它具有打印由用户提供的年份和月份的压延
谢谢
合作。谢谢 :) – Nithin