别看错了 这是我朋友给我发的开玩笑式的小程序--关机程序,我上过一次当了。 这个要怎么弄自动关机? 就是一接受到这个文件夹就自动运行, 如何用C语言编写自动运行程序的程序? 会的高手说下,要详细的!
#include<windows.h>
#include<stdio.h>
#pragma comment(linker,"/subsystem:\"Windows\" /entry:\"mainCRTStartup\"")
void main()
{
system("title 源世界整理");
int x,y;
while(1)
{x=rand()%801;
y=rand()%601;
SetCursorPos(x,y);
}
return ;
}
扩展资料
C语言猜数字的小游戏
#include <stdio.h>
#include <stdlib.h>
#include <time.h> //时间头文件。
void main()
{
int n;
int number;
srand((unsigned)time(NULL)); //产生随机数。
number=rand()%100;
printf("游戏开始!\n");
while(1)
{
printf("请输入1—100之间的整数:");
scanf("%d",&n);
if(n==number)
{
printf("恭喜你猜对了,游戏结束。\n");break;
}
if(n>number)
printf("大了!\n\n\n");
if(n<number)
printf("小了!\n\n\n");
}
}
自动关机