我刚刚学习编程,所以这似乎是一个令人厌烦的问题。但是当我尝试打印整数的值时,它会打印“1537”。这里是功能,请随意查看。
void compare(void) {
int num1;
int num2;
int num3;
int num4;
int smallest;
printf("Please enter four integers:\n");
scanf("%d %d %d %d", &num1, &num2, &num3, &num4);
num1 = smallest;
if (num2 < smallest)
num2 = smallest;
if (num3 < smallest)
num3 = smallest;
if (num4 < smallest)
num4 = smallest;
printf("%d is the smallest\n", smallest);
}