#include "cielib.h"
int main() {
int k;
k = podajK();
int d;
d = podajD();
int r;
r = podajR();
int A2[2] = {2, 2};
if (d == 2){
znalazlem(A2);
return 0;
}
int A1[1];
int L,P;
int czy;
if (d == 1){
L = 0;
P = r;
while (P > L){
A1[0] = L;
czy = czyCieplo(A1);
A1[0] = P;
czy = czyCieplo(A1);
if (czy == 1) L = (L + P) / 2;
if (czy == 0) P = (L + P) / 2;
}
A1[0] = L;
znalazlem(A1);
}
return 0;
}
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | #include "cielib.h" int main() { int k; k = podajK(); int d; d = podajD(); int r; r = podajR(); int A2[2] = {2, 2}; if (d == 2){ znalazlem(A2); return 0; } int A1[1]; int L,P; int czy; if (d == 1){ L = 0; P = r; while (P > L){ A1[0] = L; czy = czyCieplo(A1); A1[0] = P; czy = czyCieplo(A1); if (czy == 1) L = (L + P) / 2; if (czy == 0) P = (L + P) / 2; } A1[0] = L; znalazlem(A1); } return 0; } |
English