This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stdint.h> | |
#include <string.h> | |
#include <math.h> | |
#define BLOCK 30 | |
#define CHECK(X, Y) (X & (1 << (Y - 1))) | |
int main(int argc, char** argv) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stdint.h> | |
#include <string.h> | |
#include <math.h> | |
#define BLOCK 64 | |
int main(int argc, char** argv) { | |
uint64_t *prime, *mask, limit, i, j; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stdint.h> | |
#include <string.h> | |
#include <math.h> | |
#define BLOCK 64 | |
#define SHIFT(X) (1ULL << (X - 1)) | |
#define CHECK(X,Y) (X & SHIFT(Y)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stdint.h> | |
#include <string.h> | |
#include <math.h> | |
const uint64_t mask64[] = { | |
0x0000000000000001,0x0000000000000002,0x0000000000000004,0x0000000000000008, | |
0x0000000000000010,0x0000000000000020,0x0000000000000040,0x0000000000000080, | |
0x0000000000000100,0x0000000000000200,0x0000000000000400,0x0000000000000800, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* とりあえずここの中はテンプレだと思って大丈夫。 | |
** #include <ライブラリ名.h> ってやるとライブラリを使える。 | |
** stdioとstdlibがあれば大抵できるけど他にもほしくなるケースもあるよ。 | |
** int main() っていうのも定型文で、メインの処理をここに書くよ。 | |
** ※だからmainっていう名前なのね。 | |
** int argcとchar** argvはコマンドライン引数って言うよ。 | |
** コンパイルしたあとに実行するときに | |
** ./hoge 10 20 みたいにするとスペースで区切られた文字列が入ってるよ。 | |
** テンプレここから *********************************************************** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* とりあえずここの中はテンプレだと思って大丈夫。 | |
** #include <ライブラリ名.h> ってやるとライブラリを使える。 | |
** stdioとstdlibがあれば大抵できるけど他にもほしくなるケースもあるよ。 | |
** int main() っていうのも定型文で、メインの処理をここに書くよ。 | |
** ※だからmainっていう名前なのね。 | |
** int argcとchar** argvはコマンドライン引数って言うよ。 | |
** コンパイルしたあとに実行するときに | |
** ./hoge 10 20 みたいにするとスペースで区切られた文字列が入ってるよ。 | |
** テンプレここから *********************************************************** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int isPrime(int n) { | |
int i; | |
for(i = 2; i * i <= n; ++i) { | |
if(n % i == 0) { | |
return 0; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#define MAXLINE 256 | |
int main() { | |
char str1[MAXLINE]; | |
char str2[MAXLINE]; | |
char str3[MAXLINE]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
// struct listじゃなくてlistで定義できるおまじない | |
typedef struct _list { | |
char* name; | |
struct _list* next; | |
} list; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import processing.video.*; | |
Capture camera; | |
PImage picture = null; | |
void setup() { | |
size(640, 480); | |
camera = new Capture(this, 640, 480, 30); | |
camera.start(); |
OlderNewer