package main
import (
"bufio"
"fmt"
"os"
"strconv"
"strings"
)
func main(){
reader := bufio.NewReader(os.Stdin)
input, _ := reader.ReadString('\n')
input = strings.TrimSpace(input)
parts := strings.Split(input, " ")
x, _ := strconv.Atoi(parts[0])
i, _ := strconv.Atoi(parts[1])
j, _ := strconv.Atoi(parts[2])
x = swapBits(x, i, j)
fmt.Println(x)
}
func swapBits(x, i, j int) int {
if (x>>i)&1 != (x>>j)&1 {
bitmask := (1 << i) | (1 << j)
x ^= bitmask
}
return x
}
package main
import (
"fmt"
"io"
"os"
"strconv"
"strings"
)
func main() {
b := make([]byte, 1024)
reader := os.Stdin
n, err := reader.Read(b)
if err != nil && err != io.EOF {
fmt.Println("读取输入时发生错误:", err)
return
}
input := string(b[:n])
input = strings.TrimSpace(input)
parts := strings.Split(input, " ")
x, _ := strconv.Atoi(parts[0])
i, _ := strconv.Atoi(parts[1])
j, _ := strconv.Atoi(parts[2])
x = swapBits(x, i, j)
fmt.Println(x)
}
func swapBits(x, i, j int) int {
if (x>>i)&1 != (x>>j)&1 {
bitmask := (1 << i) | (1 << j)
x ^= bitmask
}
return x
}
package main
import (
"fmt"
"os"
"strconv"
"strings"
)
func main() {
b:= make([]byte,100)
n, _ := os.Stdin.Read(b)
x,_:= strconv.Atoi(strings.Split(strings.TrimSpace(string(b[:n]))," ")[0])
i,_:= strconv.Atoi(strings.Split(strings.TrimSpace(string(b[:n]))," ")[1])
j,_:= strconv.Atoi(strings.Split(strings.TrimSpace(string(b[:n]))," ")[2])
x = swapBits(x, i, j)
fmt.Println(x)
}
func swapBits(x, i, j int) int {
if (x>>i)&1 != (x>>j)&1 {
bitmask := (1 << i) | (1 << j)
x ^= bitmask
}
return x
}