#928
Se dau coordonatele în plan a trei puncte. Să se afișeze valoarea ariei triunghiului pe care îl formează.
| Problema | AriaTriunghi | Operații I/O |
ariatriunghi.in/ariatriunghi.out
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #61840126 | Utilizator | |
| Fișier | ariatriunghi.cpp | Dimensiune | 6.48 KB |
| Data încărcării | 11 Decembrie 2025, 19:24 | Scor/rezultat | Eroare de compilare |
ariatriunghi.cpp:124:13: warning: "/*" within comment [-Wcomment] /*int[] a = new int[100]; ^ ariatriunghi.cpp:1:7: error: expected nested-name-specifier before 'System' using System; ^ ariatriunghi.cpp:1:7: error: 'System' has not been declared ariatriunghi.cpp:2:7: error: expected nested-name-specifier before 'System' using System.Collections; ^ ariatriunghi.cpp:2:7: error: 'System' has not been declared ariatriunghi.cpp:2:13: error: expected ';' before '.' token using System.Collections; ^ ariatriunghi.cpp:2:13: error: expected unqualified-id before '.' token ariatriunghi.cpp:3:7: error: expected nested-name-specifier before 'System' using System.Collections.Generic; ^ ariatriunghi.cpp:3:7: error: 'System' has not been declared ariatriunghi.cpp:3:13: error: expected ';' before '.' token using System.Collections.Generic; ^ ariatriunghi.cpp:3:13: error: expected unqualified-id before '.' token ariatriunghi.cpp:4:7: error: expected nested-name-specifier before 'System' using System.Linq; ^ ariatriunghi.cpp:4:7: error: 'System' has not been declared ariatriunghi.cpp:4:13: error: expected ';' before '.' token using System.Linq; ^ ariatriunghi.cpp:4:13: error: expected unqualified-id before '.' token ariatriunghi.cpp:5:7: error: expected nested-name-specifier before 'System' using System.Text; ^ ariatriunghi.cpp:5:7: error: 'System' has not been declared ariatriunghi.cpp:5:13: error: expected ';' before '.' token using System.Text; ^ ariatriunghi.cpp:5:13: error: expected unqualified-id before '.' token ariatriunghi.cpp:6:7: error: expected nested-name-specifier before 'System' using System.Threading.Tasks; ^ ariatriunghi.cpp:6:7: error: 'System' has not been declared ariatriunghi.cpp:6:13: error: expected ';' before '.' token using System.Threading.Tasks; ^ ariatriunghi.cpp:6:13: error: expected unqualified-id before '.' token ariatriunghi.cpp:12:16: error: expected ':' before 'double' public double x, y; // variabile membre ^ ariatriunghi.cpp:14:16: error: expected ':' before 'void' public void Init(double X, double Y) // metoda ^ ariatriunghi.cpp:19:16: error: expected ':' before 'void' public void Init() // metoda ^ ariatriunghi.cpp:24:16: error: expected ':' before 'static' public static double DistantaPP(Punct A, Punct B) // distanta dintre 2 puncte ^ ariatriunghi.cpp:29:16: error: expected ':' before 'static' public static double DistantaPD(Punct A, Dreapta B) // distanta dintre un punct si o dreapta ^ ariatriunghi.cpp:29:50: error: 'Dreapta' has not been declared public static double DistantaPD(Punct A, Dreapta B) // distanta dintre un punct si o dreapta ^ ariatriunghi.cpp:34:16: error: expected ':' before 'Punct' public Punct Mijloc(Punct A, Punct B) // mijlocul segmentului dintre 2 puncte ^ ariatriunghi.cpp:42:16: error: expected ':' before 'Punct' public Punct CentruGreutate(Punct A, Punct B, Punct C) // centrul de greutate al unui triunghi ^ ariatriunghi.cpp:51:16: error: expected ':' before 'static' public static double Panta(Punct A, Punct B) // panta prin 2 puncte ^ ariatriunghi.cpp:56:16: error: expected ':' before 'static' public static double AriaTriunghi(Punct A, Punct B, Punct C) // aria unui triunghi ^ ariatriunghi.cpp:70:16: error: expected ':' before 'static' public static string PunctSegment(Punct A, Punct B, Punct C) // verifica daca A apartine segmentului BC ^ ariatriunghi.cpp:70:23: error: 'string' does not name a type public static string PunctSegment(Punct A, Punct B, Punct C) // verifica daca A apartine segmentului BC ^ ariatriunghi.cpp:87:16: error: expected ':' before 'void' public void AfisP() // afisarea coordonatelor unui punct ^ ariatriunghi.cpp:92:5: error: expected ';' after class definition } ^ ariatriunghi.cpp: In static member function 'static double Geometrie_analitica::Punct::DistantaPP(Geometrie_analitica::Punct, Geometrie_analitica::Punct)': ariatriunghi.cpp:26:20: error: 'Math' was not declared in this scope return Math.Sqrt((B.x - A.x) * (B.x - A.x) + (B.y - A.y) * (B.y - A.y)); ^ ariatriunghi.cpp: In static member function 'static double Geometrie_analitica::Punct::DistantaPD(Geometrie_analitica::Punct, int)': ariatriunghi.cpp:31:20: error: 'Math' was not declared in this scope return Math.Abs(A.x * B.a + A.y * B.b + B.c) / Math.Sqrt(B.a * B.a + B.b * B.b); ^ ariatriunghi.cpp:31:37: error: request for member 'a' in 'B', which is of non-class type 'int' return Math.Abs(A.x * B.a + A.y * B.b + B.c) / Math.Sqrt(B.a * B.a + B.b * B.b); ^ ariatriunghi.cpp:31:49: error: request for member 'b' in 'B', which is of non-class type 'int' return Math.Abs(A.x * B.a + A.y * B.b + B.c) / Math.Sqrt(B.a * B.a + B.b * B.b); ^ ariatriunghi.cpp:31:55: error: request for member 'c' in 'B', which is of non-class type 'int' return Math.Abs(A.x * B.a + A.y * B.b + B.c) / Math.Sqrt(B.a * B.a + B.b * B.b); ^ ariatriunghi.cpp:31:72: error: request for member 'a' in 'B', which is of non-class type 'int' return Math.Abs(A.x * B.a + A.y * B.b + B.c) / Math.Sqrt(B.a * B.a + B.b * B.b); ^ ariatriunghi.cpp:31:78: error: request for member 'a' in 'B', which is of non-class type 'int' return Math.Abs(A.x * B.a + A.y * B.b + B.c) / Math.Sqrt(B.a * B.a + B.b * B.b); ^ ariatriunghi.cpp:31:84: error: request for member 'b' in 'B', which is of non-class type 'int' return Math.Abs(A.x * B.a + A.y * B.b + B.c) / Math.Sqrt(B.a * B.a + B.b * B.b); ^ ariatriunghi.cpp:31:90: error: request for member 'b' in 'B', which is of non-class type 'int' return Math.Abs(A.x * B.a + A.y * B.b + B.c) / Math.Sqrt(B.a * B.a + B.b * B.b); ^ ariatriunghi.cpp: In member function 'Geometrie_analitica::Punct Geometrie_analitica::Punct::Mijloc(Geometrie_analitica::Punct, Geometrie_analitica::Punct)': ariatriunghi.cpp:36:35: error: conversion from 'Geometrie_analitica::Punct*' to non-scalar type 'Geometrie_analitica::Punct' requested Punct mij = new Punct(); ^ ariatriunghi.cpp: In member function 'Geometrie_analitica::Punct Geometrie_analitica::Punct::CentruGreutate(Geometrie_analitica::Punct, Geometrie_analitica::Punct, Geometrie_analitica::Punct)': ariatriunghi.cpp:44:34: error: conversion from 'Geometrie_analitica::Punct*' to non-scalar type 'Geometrie_analitica::Punct' requested Punct cg = new Punct(); ^ ariatriunghi.cpp: In static member function 'static double Geometrie_analitica::Punct::AriaTriunghi(Geometrie_analitica::Punct, Geometrie_analitica::Punct, Geometrie_analitica::Punct)': ariatriunghi.cpp:67:20: error: 'Math' was not declared in this scope return Math.Abs(delta) / 2; ^ ariatriunghi.cpp: In member function 'void Geometrie_analitica::Punct::AfisP()': ariatriunghi.cpp:89:13: error: 'Console' was not declared in this scope Console.WriteLine("(" + x + ";" + y + ")"); ^ ariatriunghi.cpp:89:37: error: invalid operands of types 'const char [2]' and 'double' to binary 'operator+' Console.WriteLine("(" + x + ";" + y + ")"); ^ ariatriunghi.cpp: At global scope: ariatriunghi.cpp:96:26: error: 'string' has not been declared static void Main(string[] args) ^ ariatriunghi.cpp:96:35: error: expected ',' or '...' before 'args' static void Main(string[] args) ^ ariatriunghi.cpp:224:5: error: expected ';' after class definition } ^ ariatriunghi.cpp: In static member function 'static void Geometrie_analitica::Program::Main(int*)': ariatriunghi.cpp:164:13: error: 'StreamReader' was not declared in this scope StreamReader fin2 = new StreamReader("ariatriunghi.in"); ^ ariatriunghi.cpp:164:26: error: expected ';' before 'fin2' StreamReader fin2 = new StreamReader("ariatriunghi.in"); ^ ariatriunghi.cpp:165:13: error: 'StreamWriter' was not declared in this scope StreamWriter fout2 = new StreamWriter("ariatriunghi.out"); ^ ariatriunghi.cpp:165:26: error: expected ';' before 'fout2' StreamWriter fout2 = new StreamWriter("ariatriunghi.out"); ^ ariatriunghi.cpp:166:13: error: 'string' was not declared in this scope string line = fin2.ReadLine(); ^ ariatriunghi.cpp:166:20: error: expected ';' before 'line' string line = fin2.ReadLine(); ^ ariatriunghi.cpp:167:20: error: expected primary-expression before ']' token string[] ch = line.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); ^ ariatriunghi.cpp:167:22: error: expected ';' before 'ch' string[] ch = line.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); ^ ariatriunghi.cpp:167:56: error: expected primary-expression before ',' token string[] ch = line.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); ^ ariatriunghi.cpp:167:58: error: 'StringSplitOptions' was not declared in this scope string[] ch = line.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); ^ ariatriunghi.cpp:167:95: error: expected ';' before ')' token string[] ch = line.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); ^ ariatriunghi.cpp:169:33: error: conversion from 'Geometrie_analitica::Punct*' to non-scalar type 'Geometrie_analitica::Punct' requested Punct F = new Punct(); ^ ariatriunghi.cpp:170:17: error: expected primary-expression before 'double' a = double.Parse(ch[0]); ^ ariatriunghi.cpp:170:17: error: expected ';' before 'double' ariatriunghi.cpp:171:17: error: expected primary-expression before 'double' b = double.Parse(ch[1]); ^ ariatriunghi.cpp:171:17: error: expected ';' before 'double' ariatriunghi.cpp:174:33: error: conversion from 'Geometrie_analitica::Punct*' to non-scalar type 'Geometrie_analitica::Punct' requested Punct G = new Punct(); ^ ariatriunghi.cpp:175:17: error: expected primary-expression before 'double' a = double.Parse(ch[2]); ^ ariatriunghi.cpp:175:17: error: expected ';' before 'double' ariatriunghi.cpp:176:17: error: expected primary-expression before 'double' b = double.Parse(ch[3]); ^ ariatriunghi.cpp:176:17: error: expected ';' before 'double' ariatriunghi.cpp:179:33: error: conversion from 'Geometrie_analitica::Punct*' to non-scalar type 'Geometrie_analitica::Punct' requested Punct H = new Punct(); ^ ariatriunghi.cpp:180:17: error: expected primary-expression before 'double' a = double.Parse(ch[4]); ^ ariatriunghi.cpp:180:17: error: expected ';' before 'double' ariatriunghi.cpp:181:17: error: expected primary-expression before 'double' b = double.Parse(ch[5]); ^ ariatriunghi.cpp:181:17: error: expected ';' before 'double' ariatriunghi.cpp:184:29: error: expected primary-expression before '.' token double x = Punct.AriaTriunghi(F, G, H); ^ ariatriunghi.cpp:185:13: error: 'fout2' was not declared in this scope fout2.WriteLine(x.ToString("F1")); ^ ariatriunghi.cpp:185:31: error: request for member 'ToString' in 'x', which is of non-class type 'double' fout2.WriteLine(x.ToString("F1")); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema AriaTriunghi 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ă.