Skip to content
Snippets Groups Projects
Commit 3443622d authored by Nicolas M. Thiéry's avatar Nicolas M. Thiéry
Browse files

WIMS: Correctif bug exos avec plusieurs entrees valides + ajout alerte automatique

parent 9aa7547c
No related branches found
No related tags found
No related merge requests found
...@@ -11,8 +11,12 @@ data/index: $(PROGRAMS) ...@@ -11,8 +11,12 @@ data/index: $(PROGRAMS)
done done
data/%.answer: data/%.bin data/%.answer: data/%.bin
if echo $< | grep -q _input.cpp; then \ @if echo $< | grep -q _input.cpp; then \
for i in `seq 0 99`; do if [ x`echo $$i | $<` = 'x42' ]; then echo $$i; fi; done > $@; \ count=0; \
for i in `seq 0 99`; do if [ x`echo $$i | $<` = 'x42' ]; then echo $$i; count=$$((count+1)); fi; done > $@; \
if [ $$count != 1 ]; then \
echo "ATTENTION IL N'Y A PAS EXACTEMENT UNE BONNE RÉPONSE pour $<"; \
fi; \
else \ else \
./$< > $@; \ ./$< > $@; \
fi fi
...@@ -21,7 +25,7 @@ data/%.cpp.bin: data/%.cpp ...@@ -21,7 +25,7 @@ data/%.cpp.bin: data/%.cpp
g++ -Wall -Wno-sign-compare -Wno-unused-value -pedantic -std=c++11 $< -o $@ g++ -Wall -Wno-sign-compare -Wno-unused-value -pedantic -std=c++11 $< -o $@
clean: clean:
rm data/*.bin data/*.answer data/index -rm data/*.bin data/*.answer data/index
# Pour restauration # Pour restauration
archive: archive:
......
...@@ -12,5 +12,6 @@ int main(void) { ...@@ -12,5 +12,6 @@ int main(void) {
}; };
int j; int j;
cin >> j; cin >> j;
cout << tab[3][j] << endl; if (0<=j and j<5)
cout << tab[3][j] << endl;
} }
...@@ -19,5 +19,6 @@ int main(void) { ...@@ -19,5 +19,6 @@ int main(void) {
}; };
int j; int j;
cin >> j; cin >> j;
cout << mystere(tab,j) << endl; if (0<=j and j<4)
cout << mystere(tab,j) << endl;
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment