#2842
Triplete1
C++
Se consideră subprogramul triplete
, cu un singur parametru, n
, prin care primeşte o valoare naturală din intervalul [2,10
4
]
. Subprogramul afișează pe ecran toate tripletele de numere naturale (x,y,z)
cu proprietatea că x<y<z
și x·y+y·z=n
. Fiecare triplet se afișează pe câte o linie a ecranului, iar numerele din fiecare triplet sunt separate prin câte o virgulă și încadrate între paranteze rotunde.
Scrieți definiţia completă a subprogramului.
Subiect Bacalaureat 2014, sesiunea august-septembrie
Problema | Triplete1 | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #17269598 | Utilizator | |
Fișier | triplete1.cpp | Dimensiune | 291 B |
Data încărcării | 05 Octombrie 2019, 21:01 | Scor / rezultat | Eroare de compilare |
triplete1.cpp:8:1: error: stray '\302' in program for (int y = 1; y <= 101; ++y) ^ triplete1.cpp:8:1: error: stray '\240' in program triplete1.cpp:8:1: error: stray '\302' in program triplete1.cpp:8:1: error: stray '\240' in program triplete1.cpp:10:1: error: stray '\302' in program if (n % y == 0) ^ triplete1.cpp:10:1: error: stray '\240' in program triplete1.cpp:10:1: error: stray '\302' in program triplete1.cpp:10:1: error: stray '\240' in program triplete1.cpp:10:1: error: stray '\302' in program triplete1.cpp:10:1: error: stray '\240' in program triplete1.cpp:10:1: error: stray '\302' in program triplete1.cpp:10:1: error: stray '\240' in program triplete1.cpp:12:1: error: stray '\302' in program for (int x = 0; x < y; ++x) ^ triplete1.cpp:12:1: error: stray '\240' in program triplete1.cpp:12:1: error: stray '\302' in program triplete1.cpp:12:1: error: stray '\240' in program triplete1.cpp:12:1: error: stray '\302' in program triplete1.cpp:12:1: error: stray '\240' in program triplete1.cpp:12:1: error: stray '\302' in program triplete1.cpp:12:1: error: stray '\240' in program triplete1.cpp:12:1: error: stray '\302' in program triplete1.cpp:12:1: error: stray '\240' in program triplete1.cpp:12:1: error: stray '\302' in program triplete1.cpp:12:1: error: stray '\240' in program triplete1.cpp:14:1: error: stray '\302' in program if (y < (n / y) - x) ^ triplete1.cpp:14:1: error: stray '\240' in program triplete1.cpp:14:1: error: stray '\302' in program triplete1.cpp:14:1: error: stray '\240' in program triplete1.cpp:14:1: error: stray '\302' in program triplete1.cpp:14:1: error: stray '\240' in program triplete1.cpp:14:1: error: stray '\302' in program triplete1.cpp:14:1: error: stray '\240' in program triplete1.cpp:14:1: error: stray '\302' in program triplete1.cpp:14:1: error: stray '\240' in program triplete1.cpp:14:1: error: stray '\302' in program triplete1.cpp:14:1: error: stray '\240' in program triplete1.cpp:14:1: error: stray '\302' in program triplete1.cpp:14:1: error: stray '\240' in program triplete1.cpp:14:1: error: stray '\302' in program triplete1.cpp:14:1: error: stray '\240' in program triplete1.cpp:16:1: error: stray '\302' in program cout << '(' << x << ',' << y << ',' << (n / y) - x << ")\n"; ^ triplete1.cpp:16:1: error: stray '\240' in program triplete1.cpp:16:1: error: stray '\302' in program triplete1.cpp:16:1: error: stray '\240' in program triplete1.cpp:16:1: error: stray '\302' in program triplete1.cpp:16:1: error: stray '\240' in program triplete1.cpp:16:1: error: stray '\302' in program triplete1.cpp:16:1: error: stray '\240' in program triplete1.cpp:16:1: error: stray '\302' in program triplete1.cpp:16:1: error: stray '\240' in program triplete1.cpp:16:1: error: stray '\302' in program triplete1.cpp:16:1: error: stray '\240' in program triplete1.cpp:16:1: error: stray '\302' in program triplete1.cpp:16:1: error: stray '\240' in program triplete1.cpp:16:1: error: stray '\302' in program triplete1.cpp:16:1: error: stray '\240' in program triplete1.cpp:16:1: error: stray '\302' in program triplete1.cpp:16:1: error: stray '\240' in program triplete1.cpp:16:1: error: stray '\302' in program triplete1.cpp:16:1: error: stray '\240' in program
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Triplete1 face parte din a doua categorie. Pentru aceste probleme se folosește un program suport, furnizat de propunătorul problemei. 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ă.