#1544
Muzical
C++
Gigel în timp ce așteptă să meargă la doctor se joacă cu noul lui telefon. A observat ca atunci când este pe ecranul de start și apasă pe o tastă numerică se aude o notă muzicală.
Dar lui i-a venit ideea să codeze fiecare notă muzicală în acest mod:
do1
cu numărul 0
re
cu numărul 1
mi
cu numărul 2
fa
cu numărul 3
sol
cu numărul 4
la
cu numărul 5
si
cu numărul 6
do2
cu numărul 7
El creează un cântec, ia notele muzicale și le codează ca mai sus, le adună, iar apoi împarte suma la 8
și restul rămas este nota maximă.
Ajutați-l pe Gigel sa afle nota maximă!
Problema | Muzical | Operații I/O |
muzical.in /muzical.out
|
---|---|---|---|
Limita timp | 0.25 secunde | Limita memorie |
Total: 3 MB
/
Stivă 3 MB
|
Id soluție | #14934703 | Utilizator | |
Fișier | muzical.cpp | Dimensiune | 644 B |
Data încărcării | 25 Martie 2019, 17:03 | Scor / rezultat | Eroare de compilare |
muzical.cpp:10:11: error: variable 'std::ifstream f' has initializer but incomplete type ifstream f("muzical.in"); ^ muzical.cpp:11:11: error: variable 'std::ofstream g' has initializer but incomplete type ofstream g("muzical.out"); ^ muzical.cpp: In function 'int main()': muzical.cpp:17:15: error: 'struct nota' has no member named 'reperezentare' strcpy(re.reperezentare,"re"); ^ muzical.cpp:18:7: error: no match for 'operator=' (operand types are 'nota' and 'int') re=1; ^ muzical.cpp:18:7: note: candidates are: muzical.cpp:5:8: note: nota& nota::operator=(const nota&) struct nota{ ^ muzical.cpp:5:8: note: no known conversion for argument 1 from 'int' to 'const nota&' muzical.cpp:5:8: note: nota& nota::operator=(nota&&) muzical.cpp:5:8: note: no known conversion for argument 1 from 'int' to 'nota&&' muzical.cpp:20:7: error: no match for 'operator=' (operand types are 'nota' and 'int') mi=2; ^ muzical.cpp:20:7: note: candidates are: muzical.cpp:5:8: note: nota& nota::operator=(const nota&) struct nota{ ^ muzical.cpp:5:8: note: no known conversion for argument 1 from 'int' to 'const nota&' muzical.cpp:5:8: note: nota& nota::operator=(nota&&) muzical.cpp:5:8: note: no known conversion for argument 1 from 'int' to 'nota&&' muzical.cpp:22:7: error: no match for 'operator=' (operand types are 'nota' and 'int') fa=3; ^ muzical.cpp:22:7: note: candidates are: muzical.cpp:5:8: note: nota& nota::operator=(const nota&) struct nota{ ^ muzical.cpp:5:8: note: no known conversion for argument 1 from 'int' to 'const nota&' muzical.cpp:5:8: note: nota& nota::operator=(nota&&) muzical.cpp:5:8: note: no known conversion for argument 1 from 'int' to 'nota&&' muzical.cpp:24:8: error: no match for 'operator=' (operand types are 'nota' and 'int') sol=4; ^ muzical.cpp:24:8: note: candidates are: muzical.cpp:5:8: note: nota& nota::operator=(const nota&) struct nota{ ^ muzical.cpp:5:8: note: no known conversion for argument 1 from 'int' to 'const nota&' muzical.cpp:5:8: note: nota& nota::operator=(nota&&) muzical.cpp:5:8: note: no known conversion for argument 1 from 'int' to 'nota&&' muzical.cpp:26:7: error: no match for 'operator=' (operand types are 'nota' and 'int') la=5; ^ muzical.cpp:26:7: note: candidates are: muzical.cpp:5:8: note: nota& nota::operator=(const nota&) struct nota{ ^ muzical.cpp:5:8: note: no known conversion for argument 1 from 'int' to 'const nota&' muzical.cpp:5:8: note: nota& nota::operator=(nota&&) muzical.cpp:5:8: note: no known conversion for argument 1 from 'int' to 'nota&&' muzical.cpp:28:7: error: no match for 'operator=' (operand types are 'nota' and 'int') si=6; ^ muzical.cpp:28:7: note: candidates are: muzical.cpp:5:8: note: nota& nota::operator=(const nota&) struct nota{ ^ muzical.cpp:5:8: note: no known conversion for argument 1 from 'int' to 'const nota&' muzical.cpp:5:8: note: nota& nota::operator=(nota&&) muzical.cpp:5:8: note: no known conversion for argument 1 from 'int' to 'nota&&' muzical.cpp:30:8: error: no match for 'operator=' (operand types are 'nota' and 'int') do2=7; ^ muzical.cpp:30:8: note: candidates are: muzical.cpp:5:8: note: nota& nota::operator=(const nota&) struct nota{ ^ muzical.cpp:5:8: note: no known conversion for argument 1 from 'int' to 'const nota&' muzical.cpp:5:8: note: nota& nota::operator=(nota&&) muzical.cpp:5:8: note: no known conversion for argument 1 from 'int' to 'nota&&'
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Muzical 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ă.