Sem usar uma terceira variável, só conheço assim:
x= x + y y= x - y x= x - y
Mas se for uma string, aí ferrou.
E se quiser deixar mais rápido da pra usar XOR:
$a = a \oplus b$ $b = a \oplus b$ $a = a \oplus b$
Sem usar uma terceira variável, só conheço assim:
x= x + y y= x - y x= x - y
Mas se for uma string, aí ferrou.
E se quiser deixar mais rápido da pra usar XOR:
$a = a \oplus b$ $b = a \oplus b$ $a = a \oplus b$