#2795
Resturi1
C++
Subprogramul resturi
are patru parametri, n
, x
, y
și r
, prin care primește câte un număr natural din intervalul [1,10
9
]
, r<x<y<n
. Subprogramul returnează numărul de valori naturale din intervalul [1,n]
pentru care atât restul împărțirii la x
, cât și restul împărțirii la y
, sunt egale cu r
.
Scrieţi definiţia completă a subprogramului.
Subiect Bacalaureat 2018, sesiunea iunie-iulie
Problema | Resturi1 | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #19339901 | Utilizator | |
Fișier | resturi1.cpp | Dimensiune | 278 B |
Data încărcării | 05 Decembrie 2019, 07:17 | Scor / rezultat | Eroare de compilare |
resturi1.cpp:6:1: error: stray '\302' in program int nr = 0, i; ^ resturi1.cpp:6:1: error: stray '\240' in program resturi1.cpp:6:1: error: stray '\302' in program resturi1.cpp:6:1: error: stray '\240' in program resturi1.cpp:10:1: error: stray '\302' in program y = x; ^ resturi1.cpp:10:1: error: stray '\240' in program resturi1.cpp:10:1: error: stray '\302' in program resturi1.cpp:10:1: error: stray '\240' in program resturi1.cpp:10:1: error: stray '\302' in program resturi1.cpp:10:1: error: stray '\240' in program resturi1.cpp:10:1: error: stray '\302' in program resturi1.cpp:10:1: error: stray '\240' in program resturi1.cpp:12:1: error: stray '\302' in program x = temp; ^ resturi1.cpp:12:1: error: stray '\240' in program resturi1.cpp:12:1: error: stray '\302' in program resturi1.cpp:12:1: error: stray '\240' in program resturi1.cpp:12:1: error: stray '\302' in program resturi1.cpp:12:1: error: stray '\240' in program resturi1.cpp:12:1: error: stray '\302' in program resturi1.cpp:12:1: error: stray '\240' in program resturi1.cpp:14:1: error: stray '\302' in program } ^ resturi1.cpp:14:1: error: stray '\240' in program resturi1.cpp:14:1: error: stray '\302' in program resturi1.cpp:14:1: error: stray '\240' in program resturi1.cpp:16:1: error: stray '\302' in program for (i = r; i <= n; i += y) { ^ resturi1.cpp:16:1: error: stray '\240' in program resturi1.cpp:16:1: error: stray '\302' in program resturi1.cpp:16:1: error: stray '\240' in program resturi1.cpp:18:1: error: stray '\302' in program if (i % x == r) ^ resturi1.cpp:18:1: error: stray '\240' in program resturi1.cpp:18:1: error: stray '\302' in program resturi1.cpp:18:1: error: stray '\240' in program resturi1.cpp:18:1: error: stray '\302' in program resturi1.cpp:18:1: error: stray '\240' in program resturi1.cpp:18:1: error: stray '\302' in program resturi1.cpp:18:1: error: stray '\240' in program resturi1.cpp:20:1: error: stray '\302' in program nr++; ^ resturi1.cpp:20:1: error: stray '\240' in program resturi1.cpp:20:1: error: stray '\302' in program resturi1.cpp:20:1: error: stray '\240' in program resturi1.cpp:20:1: error: stray '\302' in program resturi1.cpp:20:1: error: stray '\240' in program resturi1.cpp:20:1: error: stray '\302' in program resturi1.cpp:20:1: error: stray '\240' in program resturi1.cpp:20:1: error: stray '\302' in program resturi1.cpp:20:1: error: stray '\240' in program resturi1.cpp:20:1: error: stray '\302' in program resturi1.cpp:20:1: error: stray '\240' in program resturi1.cpp:22:1: error: stray '\302' in program } ^ resturi1.cpp:22:1: error: stray '\240' in program resturi1.cpp:22:1: error: stray '\302' in program resturi1.cpp:22:1: error: stray '\240' in program resturi1.cpp:24:1: error: stray '\302' in program return nr; ^ resturi1.cpp:24:1: error: stray '\240' in program resturi1.cpp:24:1: error: stray '\302' in program resturi1.cpp:24:1: error: stray '\240' in program
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Resturi1 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ă.