#include
#include
(資料圖片)
#include
int main()
{
srand((unsigned int)time((NULL)));
int a<5>={0};//最好初始化
for (int i=0;i<5;i++)
{
a=rand()%10;
printf("%d\n",a);
}
printf("----------------------\n");
int kmax=0;//記錄最大值下標
for (int i=0;i<4;i++)
{
kmax=i;
for (int j=i+1;j<5;j++)
{
if (a
{
kmax=j;
}
if (kmax!=i)//交換找到的最大數與原來最大數
{
int temp;
temp=a
a
a=temp;
}
}
}
————————————————————————————————————————————
輸出排序后的值
for (int i=0;i<5;i++)
{
printf("%d",a);
}
getchar();
return 0;
}
調戲窗口
#include
#include
void open()
{
ShellExecuteA(0,"open","\"D:\\Program Files (x86)\\Tencent\\TIM\\Bin\\QQScLauncher.exe\"",0,0,1);//系統(tǒng)函數打開軟件
}
void move()
{
HWND win=FindWindowA("TXGuiFoundation","TIM");//找句柄類名標題用的spy軟件獲得
while (win==NULL)
{
printf("失蹤");
}
int i=0;
while (i<900)
{
SetWindowPos(win,NULL,16*i/9,i,1,4,1);//設置位置(坐標,長寬)
Sleep(200);
i+=10;
if (i/10%2==1)
{
ShowWindow(win,SW_HIDE);//隱藏窗口
}
else
{
ShowWindow(win,SW_SHOW);//顯示窗口
}
}
}
int main()
{
system("taskkill /f /im TIM.exe ");//結束進程
Sleep(3000);
open();
Sleep(3000);
move();
system("pause");
return 0;
}
關鍵詞: