diff options
| author | cassio <cassiopc@gmail.com> | 2013-07-02 05:46:45 +0000 |
|---|---|---|
| committer | cassio <cassiopc@gmail.com> | 2013-07-02 05:46:45 +0000 |
| commit | be2491b093b1f0ca430bede679ecbb670041e483 (patch) | |
| tree | fe2da63d1811cb93e4352a43a113ace37b9f6017 /doc/tests/fontes/bits-diffbug.c | |
| parent | a9aa438ea0558eb0044cf1e54a9190ddb41b65e5 (diff) | |
| download | boca-be2491b093b1f0ca430bede679ecbb670041e483.tar.gz boca-be2491b093b1f0ca430bede679ecbb670041e483.zip | |
restructuring of boca's git
Diffstat (limited to 'doc/tests/fontes/bits-diffbug.c')
| -rw-r--r-- | doc/tests/fontes/bits-diffbug.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/doc/tests/fontes/bits-diffbug.c b/doc/tests/fontes/bits-diffbug.c new file mode 100644 index 0000000..3703152 --- /dev/null +++ b/doc/tests/fontes/bits-diffbug.c @@ -0,0 +1,25 @@ +/* this file illustrate a bug in diff that, even using -w -B -b, + * it will think that the files are different and will return + * exit code 1, when the only difference between them is a line + * in the end with a single white space. + * Author: cassio@ime.usp.br + * Last updated: 18/aug/2008 + */ +#include <stdio.h> +int main(void) { + int i, j, n, max, inst=0; + while(42) { + scanf("%d", &n); + if(!n) break; + max=1; + for(i=0; i<n; i++) { + scanf("%d", &j); + if(j>max) max=j; + } + for(i=0; max>0; i++) + max >>= 1; + printf("Instancia %d\n%d\n\n", ++inst, i*n); + } + printf(" \n"); + return 0; +} |