#1357
plusminus
Fie n
un număr natural.
Să se determine toate posibilitățile de alegere a semnelor +
și -
pentru care
n = (+|-) 1
2
+ (+|-) 2
2
+ ... + (+|-) n
2
Problema | plusminus | Operații I/O |
plusminus.in /plusminus.out
|
---|---|---|---|
Limita timp | 0.2 secunde | Limita memorie |
Total: 2 MB
/
Stivă 2 MB
|
Id soluție | #54404002 | Utilizator | |
Fișier | plusminus.cpp | Dimensiune | 1.47 KB |
Data încărcării | 27 Noiembrie 2024, 17:59 | Scor / rezultat | Eroare de compilare |
plusminus.cpp: In function 'void tipar()': plusminus.cpp:24:13: error: reference to 'cout' is ambiguous cout << "+ "; ^ plusminus.cpp:5:10: note: candidates are: std::ofstream cout ofstream cout("plusminus.out"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from plusminus.cpp:1: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ plusminus.cpp:26:13: error: reference to 'cout' is ambiguous cout << "- "; ^ plusminus.cpp:5:10: note: candidates are: std::ofstream cout ofstream cout("plusminus.out"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from plusminus.cpp:1: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ plusminus.cpp:28:5: error: reference to 'cout' is ambiguous cout << "\n"; ^ plusminus.cpp:5:10: note: candidates are: std::ofstream cout ofstream cout("plusminus.out"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from plusminus.cpp:1: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ plusminus.cpp: In function 'int main()': plusminus.cpp:52:5: error: reference to 'cin' is ambiguous cin >> n; ^ plusminus.cpp:4:10: note: candidates are: std::ifstream cin ifstream cin("plusminus.in"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from plusminus.cpp:1: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ plusminus.cpp:55:9: error: reference to 'cout' is ambiguous cout << "IMPOSIBIL\n"; ^ plusminus.cpp:5:10: note: candidates are: std::ofstream cout ofstream cout("plusminus.out"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from plusminus.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 plusminus 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ă.