Warning: mysqli::__construct(): (HY000/1203): User howardkn already has more than 'max_user_connections' active connections in D:\Inetpub\vhosts\howardknight.net\al.howardknight.net\includes\artfuncs.php on line 21
Failed to connect to MySQL: (1203) User howardkn already has more than 'max_user_connections' active connectionsPath: ...!news.mixmin.net!weretis.net!feeder8.news.weretis.net!pasdenom.info!nntpfeed.proxad.net!proxad.net!feeder1-1.proxad.net!cleanfeed1-b.proxad.net!nnrp2-2.free.fr!not-for-mail
Date: Fri, 30 Sep 2022 07:17:16 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:102.0) Gecko/20100101
Thunderbird/102.3.0
Newsgroups: fr.sci.maths,fr.comp.lang.python
Content-Language: fr
From: ast
Subject: Que fait ce programme ?
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Lines: 21
Message-ID: <63367bdd$0$25804$426a74cc@news.free.fr>
Organization: Guest of ProXad - France
NNTP-Posting-Date: 30 Sep 2022 07:17:17 CEST
NNTP-Posting-Host: 91.170.32.5
X-Trace: 1664515037 news-1.free.fr 25804 91.170.32.5:13705
X-Complaints-To: abuse@proxad.net
Bytes: 1324
Devinette: Que retourne cette petite fonction python
(m et n sont 2 entiers naturels)
def f(m, n):
while n:
m, n = m ^ n, (m & n) << 1
return m
pour ceux qui ne connaissent pas python
"while n" c'est "pendant que n est non nul"
^ est l'opérateur "ou exclusif" bit à bit
& est le "et" bit à bit
<< 1 décalage à gauche bit à bit et ajout d'un 0 à droite
a, b = c, d affectation simultanée a <- c et b <- d