All pastes #762409 Raw Edit

Miscellany

public c v1 · immutable
·published 2007-11-05 17:34 UTC
rendered paste body
#include <stdio.h>int cellule_ouverte(int n, int p) {	//insérez votre code ici	int porte = 0;	long i = 1, j = 1;	//* méthode fine, trop longue a trouver, ctb xD	//	Cette méthode a été déduite depuis l'observation de le graphique	//	des resultats sur [0;100] et [1;1000].	while( i <= p ) {		if( ( p == i ) ) {			porte = 1;		}		i += j += 2;	}	//*/	/* méthode bourine, trop longue, cmb ^^	for( i = 1; i <= p; i ++ ) {		if( !( p % i ) ) {			porte = ( porte ) ? 0 : 1;		}	}	//*/	return porte;}int main(){  int n,p,res;  scanf("%d%d", &n, &p);  res = cellule_ouverte(n,p);  printf("%d\n",res);  return 0;}