mirror of
https://github.com/appinfosapienza/so-un-bot.git
synced 2025-05-07 00:19:36 +02:00
move legacy code to separate branch
This commit is contained in:
parent
68a30c8ee6
commit
11b4c48c3a
3528 changed files with 14477 additions and 53258 deletions
4
Data/ingsw/0120_35/quest.txt
Normal file
4
Data/ingsw/0120_35/quest.txt
Normal file
|
@ -0,0 +1,4 @@
|
|||
Pre-condizioni, invarianti e post-condizioni di un programma possono essere definiti usando la macro del C assert() (in <assert.h>). In particolare, assert(expre) non fa nulla se l'espressione expre vale TRUE (cioè non è 0), stampa un messaggio di errore su stderr e abortisce l'esecuzione del programma altrimenti.
|
||||
Si consideri la funzione C
|
||||
int f(int x, int y) { ..... }
|
||||
Quale delle seguenti assert esprime l'invariante che le variabili locali z e w di f() hanno somma minore di 1 oppure maggiore di 7 ?
|
6
Data/ingsw/0120_35/wrong1.txt
Normal file
6
Data/ingsw/0120_35/wrong1.txt
Normal file
|
@ -0,0 +1,6 @@
|
|||
int f(in x, int y)
|
||||
{
|
||||
int z, w;
|
||||
assert( (z + w <= 1) || (z + w >= 7));
|
||||
.....
|
||||
}
|
6
Data/ingsw/0120_35/wrong2.txt
Normal file
6
Data/ingsw/0120_35/wrong2.txt
Normal file
|
@ -0,0 +1,6 @@
|
|||
int f(in x, int y)
|
||||
{
|
||||
int z, w;
|
||||
assert( (z + w < 1) || (z + w > 7));
|
||||
.....
|
||||
}
|
6
Data/ingsw/0120_35/wrong3.txt
Normal file
6
Data/ingsw/0120_35/wrong3.txt
Normal file
|
@ -0,0 +1,6 @@
|
|||
int f(in x, int y)
|
||||
{
|
||||
int z, w;
|
||||
assert( (z + w > 1) || (z + w < 7));
|
||||
.....
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue