Answer the question
In order to leave comments, you need to log in
C++, error while compiling code?
#include <string.h>
#include <math.h>
#include <iostream>
#include <locale.h>
#include <stdio.h>
#include "my_mega_pack_NativeCallsClass.h"
JNIEXPORT jdouble JNICALL Java_my_mega_pack_NativeCallsClass_lab11
(JNIEnv * jenv, jobject jobj, jdouble a1, jdouble b1) {
setlocale(LC_ALL, "Russian");
double c;
if (a1>0 && b1 / a1>0) {
c = ((pow(a1, 1.0 / 3))* (cos((exp(b1) - 1)*3.14 / 180 * 45))) / (0.5121*(1 - (log(b1 / a1))));
}
else {
return 0;
}
return c;
};
JNIEXPORT jboolean JNICALL Java_my_mega_pack_NativeCallsClass_lab12
(JNIEnv * jenv, jobject jobj, jdouble x, jdouble y) {
setlocale(LC_ALL, "Russian");
if (x*x + y * y<1 && ((y - x) - 1)<0 && ((x + y) - 1)<0) {
return true;
}
else {
return false;
}
};
JNIEXPORT jdouble JNICALL Java_my_mega_pack_NativeCallsClass_lab13
(JNIEnv * jenv, jobject jobj, jint E) {
setlocale(LC_ALL, "Russian");
double result = 0, a, b, c, d, e = 0;
printf("Введите точность расчетов E: ");
scanf_s("%d", &E);
if (E > 0 && E == (long long)E) {
for (int n = 1; n < E + 1; n++) {
a = 2 * n;
b = pow(3, n);
c = b * b;
d = a / c;
e = e + d;
}
return e;
}
else {
if (E > 0) { return 0; }
else { return -1.0; }
}
};
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xlocale(341): warning C4530: Использован обработчик исключений C++, но семантика уничтожения объектов не включена. Задайте параметр /EHsc
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\exception(359): warning C4577: "noexcept" использовано без указания режима обработки исключений; прекращение по исключению не гарантируется. Укажите /EHsc
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question