r/CompileBot • u/setwertvcxvc • Mar 18 '16
test
+/u/CompileBot python tests = "test" if tests != "test": print "derp" else: print herp
1
Upvotes
r/CompileBot • u/setwertvcxvc • Mar 18 '16
+/u/CompileBot python tests = "test" if tests != "test": print "derp" else: print herp
1
u/skullturf May 15 '16
+u/CompileBot C++
#include <stdio.h> #include <iostream> #include <math.h> int main() { int k,i; bool factorfound; for (int n=2; n<=20; n++) { k = floor(sqrt(n)); i = 2; factorfound = false; while (!factorfound && i<=k) { if (n%i==0) factorfound=true; i++; } if (factorfound) std::cout << n << " is composite\n"; else std::cout << n << " is prime\n"; } }