#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <math.h>
#include <stdio.h>
#define DIV 720
int main()
{
double s1, s2, s3, h, rad;
int m, n, x;
while (1) {
if (m == 0 || n == 0) {
break;
}
s1 = s2 = s3 = 0.0;
h = 2.0 / DIV;
for (x = 0; x < DIV; x++) {
rad = 2 * M_PI * x / DIV;
s1
+= sin(n
* rad
) * sin(m
* rad
) * h
; s2
+= cos(n
* rad
) * cos(m
* rad
) * h
; s3
+= sin(n
* rad
) * cos(m
* rad
) * h
; }
printf("\nm=%d n=%d\n", m
, n
); }
return 0;
}
I2RlZmluZSBfQ1JUX1NFQ1VSRV9OT19XQVJOSU5HUwojZGVmaW5lIF9VU0VfTUFUSF9ERUZJTkVTCiNpbmNsdWRlIDxtYXRoLmg+CiNpbmNsdWRlIDxzdGRpby5oPgoKI2RlZmluZSBESVYgNzIwCgppbnQgbWFpbigpCnsKCWRvdWJsZQlzMSwgczIsIHMzLCBoLCByYWQ7CglpbnQJbSwgbiwgeDsKCgl3aGlsZSAoMSkgewoJCXByaW50ZigibSBuPSIpOwoJCXNjYW5mKCIlZCVkIiwgJm0sICZuKTsKCQlpZiAobSA9PSAwIHx8IG4gPT0gMCkgewoJCQlicmVhazsKCQl9CgkJczEgPSBzMiA9IHMzID0gMC4wOwoJCWggPSAyLjAgLyBESVY7CgkJZm9yICh4ID0gMDsgeCA8IERJVjsgeCsrKSB7CgkJCXJhZCA9IDIgKiBNX1BJICogeCAvIERJVjsKCQkJczEgKz0gc2luKG4gKiByYWQpICogc2luKG0gKiByYWQpICogaDsKCQkJczIgKz0gY29zKG4gKiByYWQpICogY29zKG0gKiByYWQpICogaDsKCQkJczMgKz0gc2luKG4gKiByYWQpICogY29zKG0gKiByYWQpICogaDsKCQl9CgkJcHJpbnRmKCJcbm09JWQgbj0lZFxuIiwgbSwgbik7CgkJcHJpbnRmKCJTMT0lZlxuIiwgczEpOwoJCXByaW50ZigiUzI9JWZcbiIsIHMyKTsKCQlwcmludGYoIlMzPSVmXG4iLCBzMyk7Cgl9CglyZXR1cm4gMDsKfQo=