#934
Se dau în plan, un punct și un segment. Să se determine distanța minimă de la punctul dat la un punct aparținând segmentului.
| Problema | DistantaPunctSegment | Operații I/O |
distantapunctsegment.in/distantapunctsegment.out
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64129750 | Utilizator | |
| Fișier | distantapunctsegment.cpp | Dimensiune | 1.08 KB |
| Data încărcării | 19 Aprilie 2026, 14:28 | Scor/rezultat | Eroare de compilare |
distantapunctsegment.cpp: In function ‘int main()’: distantapunctsegment.cpp:28:26: error: ‘APx’ was not declared in this scope; did you mean ‘Apx’? 28 | double dot_A = ABx * APx + ABy * APy; | ^~~ | Apx distantapunctsegment.cpp:32:8: error: ‘dotA’ was not declared in this scope; did you mean ‘dot_A’? 32 | if(dotA<0) | ^~~~ | dot_A distantapunctsegment.cpp:22:12: warning: unused variable ‘Apx’ [-Wunused-variable] 22 | double Apx=xP-xA; | ^~~ distantapunctsegment.cpp:28:12: warning: unused variable ‘dot_A’ [-Wunused-variable] 28 | double dot_A = ABx * APx + ABy * APy; | ^~~~~ distantapunctsegment.cpp:29:12: warning: unused variable ‘dot_B’ [-Wunused-variable] 29 | double dot_B = (-ABx) * BPx + (-ABy) * BPy; | ^~~~~ distantapunctsegment.cpp: At global scope: distantapunctsegment.cpp:34:7: error: expected unqualified-id before ‘else’ 34 | } else if (dot_B < 0) { | ^~~~ distantapunctsegment.cpp:36:7: error: expected unqualified-id before ‘else’ 36 | } else { | ^~~~ distantapunctsegment.cpp:41:35: error: ‘d_min’ was not declared in this scope 41 | double rezultat_final = floor(d_min * 100 + 0.0000001) / 100.0; | ^~~~~ distantapunctsegment.cpp:43:5: error: ‘g’ does not name a type 43 | g << fixed << setprecision(2) << rezultat_final << endl; | ^ distantapunctsegment.cpp:45:5: error: ‘f’ does not name a type 45 | f.close(); | ^ distantapunctsegment.cpp:46:5: error: ‘g’ does not name a type 46 | g.close(); | ^ distantapunctsegment.cpp:47:5: error: expected unqualified-id before ‘return’ 47 | return 0; | ^~~~~~ distantapunctsegment.cpp:48:1: error: expected declaration before ‘}’ token 48 | } | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema DistantaPunctSegment face parte din prima categorie. Soluția propusă de tine va fi evaluată astfel:
Suma punctajelor acordate pe testele utilizate pentru verificare este 100. Astfel, soluția ta poate obține cel mult 100 de puncte, caz în care se poate considera corectă.