aboutsummaryrefslogtreecommitdiff
path: root/boca-1.5.2/doc/tests/fontes/bits-diffbug.c
diff options
context:
space:
mode:
authorcassiopc <cassiopc@gmail.com>2012-10-24 07:56:07 +0000
committercassiopc <cassiopc@gmail.com>2012-10-24 07:56:07 +0000
commit3a5f406ff59a05c0eddda191127d58b39cb8049b (patch)
treef3ff6adfea30fba8271dedc81d7d652737ae397e /boca-1.5.2/doc/tests/fontes/bits-diffbug.c
parent9ae5ead9f89bcc7195420bdf6cc78db2c63dbeda (diff)
downloadboca-3a5f406ff59a05c0eddda191127d58b39cb8049b.tar.gz
boca-3a5f406ff59a05c0eddda191127d58b39cb8049b.zip
open dir for 1.5.2. I still must split devel and master in different branches to properly use git...
Diffstat (limited to 'boca-1.5.2/doc/tests/fontes/bits-diffbug.c')
-rw-r--r--boca-1.5.2/doc/tests/fontes/bits-diffbug.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/boca-1.5.2/doc/tests/fontes/bits-diffbug.c b/boca-1.5.2/doc/tests/fontes/bits-diffbug.c
new file mode 100644
index 0000000..3703152
--- /dev/null
+++ b/boca-1.5.2/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;
+}