#include <stdio.h> static bool result[10000] = {0}; void fun() { bool* p = &result[0]; for (int i = 0; i < 10000; i++) *p++ = true; int t; for (int i = 2; i < 10000; i++) { if (!result[i]) continue; for (int j = 2; j < 10000; j++) { t = i * j; if (t > 10000) break; result[t] = false; } } for (int i = 0; i < 10000; i++) if (result[i]) printf("%d ", i); } int main() { char s[] = "//123456/x21233456/t"; printf("%d,||%s", strlen(s), s); fun(); return 0; }