//两值交换 public static void Show(ref int num1,ref int num2) { int num=num1; num1=num2; num2=num; } static void Mian(string [] args) { int num1=7; int num2=4; console.WritLine("交换前,num1:{0},num2:{1}",num1,num2); Show(ref num1,ref num2); console.Wri…
// 不用大与小与号,求两数最大值 #include <stdio.h> int max(int a, int b) { int c = a - b; int d = 1 << 31; if ((c&d) == 0) { return a; } else { return b; } } int main() { printf("%d是大数\n", max(0, 2)); printf("%d是大数\n", max(3, 4)); pr…