APL/APL1.2/TP09/mystere.c

13 lines
228 B
C
Raw Normal View History

2022-01-18 12:52:55 +01:00
#include <stdio.h>
#include <stdlib.h>
unsigned int mystere(unsigned int a,unsigned int b) {
if (b==0)
return 0;
else
return a*(b & 1)+mystere(a<<1,b>>1);
}
int main(void) {
printf("%d\n", mystere(105, 50));
}