可以通过比较三个数之间的大小关系来判断它们的大小。以下是一个示例代码:
#includeint main() { int num1, num2, num3; printf("Enter three numbers: "); scanf("%d %d %d", &num1, &num2, &num3); if (num1 >= num2 && num1 >= num3) { printf("%d is the largest number\n", num1); } else if (num2 >= num1 && num2 >= num3) { printf("%d is the largest number\n", num2); } else { printf("%d is the largest number\n", num3); } return 0; }
在上面的示例中,首先从用户那里获取三个数字,然后通过比较它们之间的大小关系来确定哪一个是最大的。这个示例只是一个简单的方法,有多种其他方法可以用来判断三个数的大小。