fiche de maths

449 mots 2 pages
void main() { int a = readInt("1:Pierre 2:Papier 3:Ciseaux"); int b = readInt("1:Pierre 2:Papier 3:Ciseaux"); if (a == 1) { if (b == 1) { message("Pierre contre Pierre: égalité");
} else if (b == 2) { message("Pierre contre Papier: Joueur 2 gagne");
} else if (b == 3) { message("Pierre contre Ciseaux: Joueur 1 gagne");
} else { message("Erreur"); }

/* cas joueur1=papier*/
} else if (a == 2) {

if (b == 1) { message("Papier contre Pierre: Joueur 1 gagne");
} else if (b == 2) { message("Papier contre Papier: égalité");
} else if (b == 3) { message("Papier contre Ciseaux: Joueur 2 gagne");
} else { message("Erreur"); }
} else if (a == 3) { if (b == 1) { message("Ciseaux contre Pierre: Joueur 2 gagne");
} else if (b == 2) { message("Ciseaux contre Papier: Joueur 1 gagne");
} else if (b == 3) { message("Ciseaux contre Ciseaux: égalité");
}
}
}



double double norme(double x,double y) { return sqrt(x*x+y*y);
}

void fonction() { instructions } void fonction(type1 nom1,…) { instructions } type_retour fonction() {

double

instructions
}
type_retour fonction(type1 nom1,…) { instructions }
,

.

int coup(String coup) { int reponse; if (coup.equalsIgnoreCase("pierre")) { reponse = 1;
} else if (coup.equalsIgnoreCase("papier")) {

reponse = 2;
} else if (coup.equalsIgnoreCase("ciseaux")) { reponse = 3;
} else { reponse = -1;
}
return reponse;
}
void main() {
String coupA = readString("Pierre, Papier ou Ciseaux ?"); int a = coup(coupA);
String coupB = readString("Pierre, Papier ou Ciseaux ?"); int b = coup(coupB); if (a == 1) { if (b == 1) {


return

int coup(String coup) { if (coup.equalsIgnoreCase("pierre")) { return 1;
}
if (coup.equalsIgnoreCase("papier")) { return 2;
}
if (coup.equalsIgnoreCase("ciseaux")) { return 3;
}
return -1;
}

else





int f(int x) { int y=2*x; return 2*y+1;
}

int g(int x) { int y=3*x; return f(y)+x;
}



en relation

  • maths
    263 mots | 2 pages
  • Mathématiques
    285 mots | 2 pages
  • Mathématiques
    364 mots | 2 pages
  • maths
    850 mots | 4 pages
  • Dm de math exponentielle
    599 mots | 3 pages
  • 179449_chap04_corr
    5120 mots | 21 pages
  • maths
    908 mots | 4 pages
  • Crpe dossier de maths
    3427 mots | 14 pages
  • maths
    6640 mots | 27 pages
  • maths
    388 mots | 2 pages
  • maths
    346 mots | 2 pages
  • Dossier de math
    539 mots | 3 pages
  • Phython
    450 mots | 2 pages
  • maths
    640 mots | 3 pages
  • Les maths
    1228 mots | 5 pages