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
/* -*- mode: C -*- */ | |
#include <stdlib.h> | |
#include <stdio.h> | |
/* プログラムの本体 */ | |
int main(void) { | |
// 宣言 | |
double A[5] = { | |
[0] = 9.0, | |
[1] = 2.9, |
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 power_mod(int b, int e, int m) { | |
int r = 1; | |
for (int i = 0; i < e; ++i) { | |
r = (r * b) % m; | |
} | |
return r; | |
} |
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 gcd(int a, int b) { | |
int r; | |
for (;;) { | |
r = a % b; | |
if (!r) | |
break; | |
a = b; | |
b = r; |