#2029
AfisareN
Citindu-se un număr natural n
şi un şir de caractere să se afişeze de n
ori şirul de caractere.
Problema | AfisareN | Operații I/O |
afisaren.in /afisaren.out
|
---|---|---|---|
Limita timp | 0.27 secunde | Limita memorie |
Total: 0.1 MB
/
Stivă 0.1 MB
|
Id soluție | #53537953 | Utilizator | |
Fișier | afisaren.cpp | Dimensiune | 433 B |
Data încărcării | 04 Noiembrie 2024, 16:43 | Scor / rezultat | Eroare de compilare |
afisaren.cpp:3:1: error: expected initializer before 'using' using namespace std; ^ afisaren.cpp:5:1: error: 'ifstream' does not name a type ifstream cin("afisaren.in"); ^ afisaren.cpp:6:1: error: 'ofstream' does not name a type ofstream cout("afisaren.out"); ^ afisaren.cpp: In function 'int main()': afisaren.cpp:11:5: error: 'cin' was not declared in this scope cin >> n; ^ afisaren.cpp:11:5: note: suggested alternative: In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from afisaren.cpp:1: /usr/include/c++/4.8/iostream:60:18: note: 'std::cin' extern istream cin; /// Linked to standard input ^ afisaren.cpp:15:9: error: 'ifstream' was not declared in this scope ifstream cin("afisaren.in"); ^ afisaren.cpp:15:9: note: suggested alternative: In file included from /usr/include/c++/4.8/ios:38:0, from /usr/include/c++/4.8/istream:38, from /usr/include/c++/4.8/sstream:38, from /usr/include/c++/4.8/complex:45, from /usr/include/c++/4.8/ccomplex:38, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52, from afisaren.cpp:1: /usr/include/c++/4.8/iosfwd:157:34: note: 'std::ifstream' typedef basic_ifstream<char> ifstream; ^ afisaren.cpp:15:18: error: expected ';' before 'cin' ifstream cin("afisaren.in"); ^ afisaren.cpp:20:9: error: 'cout' was not declared in this scope cout << ch; ^ afisaren.cpp:20:9: note: suggested alternative: In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from afisaren.cpp:1: /usr/include/c++/4.8/iostream:61:18: note: 'std::cout' extern ostream cout; /// Linked to standard output ^ afisaren.cpp:21:9: error: 'cout' was not declared in this scope cout << endl; ^ afisaren.cpp:21:9: note: suggested alternative: In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from afisaren.cpp:1: /usr/include/c++/4.8/iostream:61:18: note: 'std::cout' extern ostream cout; /// Linked to standard output ^ afisaren.cpp:21:17: error: 'endl' was not declared in this scope cout << endl; ^ afisaren.cpp:21:17: note: suggested alternative: In file included from /usr/include/c++/4.8/istream:39:0, from /usr/include/c++/4.8/sstream:38, from /usr/include/c++/4.8/complex:45, from /usr/include/c++/4.8/ccomplex:38, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52, from afisaren.cpp:1: /usr/include/c++/4.8/ostream:564:5: note: 'std::endl' endl(basic_ostream<_CharT, _Traits>& __os) ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema AfisareN 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ă.