#include <stdio.h>
double sp(int r[2]) {
double V[] = {0,0};
double v = 1;
for (int Vv = 0; Vv<r[1]; Vv++) {
v *= 0.1;
}
for(double k = 1; k>v ; k *= 0.1) {
while(((2*V[0]+V[1])*V[1])<(r[0]-V[0]*V[0])){
V[1] += k;
}
V[0] += V[1] - k;
V[1] = 0;
}
return V[0];
}
int main() {
int V[] = {2,10};
printf("%f",sp(V));
}
To embed this project on your website, copy the following code and paste it into your website's HTML: