Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vérification de l'utilisation de fonctions #7

Open
obonaventure opened this issue Feb 26, 2018 · 0 comments
Open

Vérification de l'utilisation de fonctions #7

obonaventure opened this issue Feb 26, 2018 · 0 comments
Labels
enhancement New feature or request

Comments

@obonaventure
Copy link
Contributor

Pour la question test, un étudiant propose

#include <stdlib.h>
#include <string.h>
int main(int argc,char *argv[]){
if(!strcmp(argv[2],"-ne")){
return atof(argv[1])==atof(argv[3]);
}
else if(!strcmp(argv[2],"-ge")){
return atof(argv[1])<atof(argv[3]);
}
else if(!strcmp(argv[2],"-gt")){
return atof(argv[1])<=atof(argv[3]);
}
else if(!strcmp(argv[2],"-le")){
return atof(argv[1])>atof(argv[3]);
}
else if(!strcmp(argv[2],"-lt")){
return atof(argv[1])>=atof(argv[3]);
}
else if(!strcmp(argv[2],"-eq")){
return atof(argv[1])!=atof(argv[3]);
}
else{
return 0;
}
}

comment faire en C pour compter efficacement le nombre de sous-fonctions qui sont implémentés et les forcer à utiliser des sous-fonctions ?

@obonaventure obonaventure added the enhancement New feature or request label Feb 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant