#include <stdio.h> #include <stdlib.h> int guess (int x, int y) { if (x == y) return x; if (x > y) return guess(x - 1, y) + guess(x, y + 1); return guess(x + 1, y) + guess(x, y - 1); } int main() { int x = 0; int y = 0; printf("Donnez x et y:"); scanf("%d %d", &x, &y); printf("Res: %d\n", guess(x, y)); return 0; }
Améliorer votre expérience CodeS-SourceS avec ce plugin:
ttp://codes-sources.commentcamarche.net/forum/affich-10000111-plugin-better-cs-2#cptpingu-signature