/* # Copyright (c) 2008 Bessot Jean-Michel # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. */ int main() { /* déclaration des variables et paramètres */ int i=1,n=1,t=1,j,p,pl=1,pt=1; printf ("saisie du nombre de pliages : "); scanf ("%i",&p); /* calcul du nombre de plis (pl) avec le nombre de pliages (p) */ while ( i < p ) { t *= 2; pl += t; i++; } printf ("Nombre de pliages inférieur à 21: %i\n",pl); /* déclaration du tableau et mise en place de la convention sur la valeur centrale*/ int A[pl]; /* mise en place du tableau 1 011 0011011 001001110011011 */ if (pl == 1) {A[0]=1;} else { A[pl/2]=1; t=1; while (n