No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

juste_prix.c 347B

1234567891011121314151617181920212223242526
  1. int chose_number() {
  2. int i = get();
  3. return i;
  4. }
  5. int compare(int nb, int prop) {
  6. int rt;
  7. if (prop > nb) {
  8. rt = -1;
  9. } else if (prop < nb) {
  10. rt = 1;
  11. } else {
  12. rt = 0;
  13. }
  14. return rt;
  15. }
  16. int main() {
  17. int valeur = chose_number();
  18. int prop = valeur + 50;
  19. while (!(prop == valeur)) {
  20. prop = get();
  21. printf(compare(valeur, prop));
  22. }
  23. }