我设置了输入a和b,但输入a之后就直接退出了,为啥
#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include<string.h>
int Max(int a, int b)
{
if (a > b)
return a;
else(a > b);
return b;
}
int main()
{
int a = 0;
int b = 0;
printf("请输入a的值\n");
scanf("%d", a);
printf("请输入b的值\n");
scanf("%d", b);
int max = 0;
max = Max(a, b);
printf("%d\n", max);
return 0;
}
这里有个之前做的,同样都是 打印→定义→输入,为啥我这个就不行
#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <Windows.h>
int main()
{
printf("请输入轰炸的次数\n");
int Message_Num;
scanf("%d", &Message_Num);
printf("请输入轰炸的对象\n");
char num[10];
scanf("%s", num);
FindWindow(NULL, num);
while (Message_Num>0)
{
SendMessage(FindWindow(NULL, num),WM_PASTE,NULL,0);
SendMessage(FindWindow(NULL, num),WM_KEYDOWN,VK_RETURN,0);
Message_Num--;
}
return 0;
}