#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 | #50075188 | Utilizator | |
Fișier | muzical.cpp | Dimensiune | 1.06 KB |
Data încărcării | 26 Martie 2024, 11:27 | Scor / rezultat | Eroare de compilare |
muzical.cpp: In function 'int main()': muzical.cpp:11:5: error: reference to 'cin' is ambiguous cin >> n; ^ muzical.cpp:4:10: note: candidates are: std::ifstream cin ifstream cin("muzical.in"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from muzical.cpp:1: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ muzical.cpp:15:9: error: reference to 'cin' is ambiguous cin >> ch1 >> ch2; ^ muzical.cpp:4:10: note: candidates are: std::ifstream cin ifstream cin("muzical.in"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from muzical.cpp:1: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ muzical.cpp:18:9: error: reference to 'cin' is ambiguous cin >> ch3; ^ muzical.cpp:4:10: note: candidates are: std::ifstream cin ifstream cin("muzical.in"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from muzical.cpp:1: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ muzical.cpp:32:13: error: reference to 'cin' is ambiguous cin >> ch3; ^ muzical.cpp:4:10: note: candidates are: std::ifstream cin ifstream cin("muzical.in"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from muzical.cpp:1: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ muzical.cpp:42:9: error: reference to 'cout' is ambiguous cout << "do1"; ^ muzical.cpp:5:10: note: candidates are: std::ofstream cout ofstream cout("muzical.out"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from muzical.cpp:1: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ muzical.cpp:44:9: error: reference to 'cout' is ambiguous cout << "re"; ^ muzical.cpp:5:10: note: candidates are: std::ofstream cout ofstream cout("muzical.out"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from muzical.cpp:1: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ muzical.cpp:46:9: error: reference to 'cout' is ambiguous cout << "mi"; ^ muzical.cpp:5:10: note: candidates are: std::ofstream cout ofstream cout("muzical.out"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from muzical.cpp:1: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ muzical.cpp:48:9: error: reference to 'cout' is ambiguous cout << "fa"; ^ muzical.cpp:5:10: note: candidates are: std::ofstream cout ofstream cout("muzical.out"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from muzical.cpp:1: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ muzical.cpp:50:9: error: reference to 'cout' is ambiguous cout << "sol"; ^ muzical.cpp:5:10: note: candidates are: std::ofstream cout ofstream cout("muzical.out"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from muzical.cpp:1: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ muzical.cpp:52:9: error: reference to 'cout' is ambiguous cout << "la"; ^ muzical.cpp:5:10: note: candidates are: std::ofstream cout ofstream cout("muzical.out"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from muzical.cpp:1: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ muzical.cpp:54:9: error: reference to 'cout' is ambiguous cout << "si"; ^ muzical.cpp:5:10: note: candidates are: std::ofstream cout ofstream cout("muzical.out"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from muzical.cpp:1: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ muzical.cpp:56:9: error: reference to 'cout' is ambiguous cout << "do2"; ^ muzical.cpp:5:10: note: candidates are: std::ofstream cout ofstream cout("muzical.out"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from muzical.cpp:1: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^
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ă.