2 Commits 03b9178f72 ... 170815ea4f

Auteur SHA1 Bericht Datum
  Hacker GNU 170815ea4f 3 operator 2 jaren geleden
  Hacker GNU 8add938cb9 C Puzzle started 2 jaren geleden
4 gewijzigde bestanden met toevoegingen van 36 en 0 verwijderingen
  1. BIN
      src/cpuzzle/operator2
  2. 15 0
      src/cpuzzle/operator2.c
  3. BIN
      src/cpuzzle/operator3
  4. 21 0
      src/cpuzzle/operator3.c

BIN
src/cpuzzle/operator2


+ 15 - 0
src/cpuzzle/operator2.c

@@ -0,0 +1,15 @@
+#include <stdio.h>
+
+#define PRINTX printf("x=%d ", x)
+#define PRINTY printf("y=%d ", y)
+#define PRINTZ printf("z=%d\n", z)
+
+int main()
+{
+int x=2, y=0, z=0;
+PRINTX;
+x*=3+2; PRINTX; PRINTY; PRINTZ;
+x*=y=z=4; PRINTX; PRINTY; PRINTZ;
+x=y==z; PRINTX; PRINTY; PRINTZ;
+//x==(y=z); PRINTX;
+}

BIN
src/cpuzzle/operator3


+ 21 - 0
src/cpuzzle/operator3.c

@@ -0,0 +1,21 @@
+#include <stdio.h>
+
+#define PRINT(int) printf("%d\n", int)
+
+
+int main()
+	{
+	int x, y, z;
+
+	x=2; y=1; z=0;
+	
+	x=x&&y||z; PRINT(x);
+	PRINT(x||!y&&z);
+
+	x=y=1;
+	x=x++ -1; PRINT(x); PRINT(z);
+	z+=-x++ + ++y; PRINT(x); PRINT(z);
+	z=x/++x; PRINT(z);
+
+}
+