Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我很难从 C 函数中获得真正的输出。例如:
int max3(int a, int b, int c){ if ((a>b)&&(a>c)) return a; if ((b>c)&&(b>a)) return b; return c; }
你能告诉我如何指定实际输出(例如工具、算法等)吗?在上面的示例中,实际输出为 6(如果 (a,b,c) = (1,2,6))。非常感谢。
我可能已经使用三元运算符编写了它,因为它很简单:
int max3(int a, int b, int c){ if (a>b) return (a>c)?a:c; else return (b>c)?b:c; }