#1376
LaturiTriunghi
Se dă n
. Afișați un triunghi cu latura de n
steluțe gol înăuntru.
Problema | LaturiTriunghi | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.01 secunde | Limita memorie |
Total: 10 MB
/
Stivă 2 MB
|
Id soluție | #11657187 | Utilizator | |
Fișier | laturitriunghi.cpp | Dimensiune | 478 B |
Data încărcării | 05 Noiembrie 2018, 20:12 | Scor / rezultat | Eroare de compilare |
laturitriunghi.cpp:1:10: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix] #include <iostream>using namespace std; ^ laturitriunghi.cpp:1:20: warning: extra tokens at end of #include directive [enabled by default] #include <iostream>using namespace std; ^ laturitriunghi.cpp:2:1: error: stray '\302' in program int main(){ int n, i; cin>>n; for (i=1; i<n; i++) cout<<" "; cout<<"*"; for (i=1; i<n; i++) cout<<" "; cout<<endl; for (i=2; i<n; i++) { for (int j=1; j<=2*n-1; j++) if (i+j==n+1 || j-i==n-1) cout<<"*"; else cout<<" "; cout<<endl; } if (n>1) for (i=1; i<=n; i++) cout<<"* "; return 0;} ^ laturitriunghi.cpp:2:1: error: stray '\240' in program laturitriunghi.cpp:2:1: error: stray '\302' in program laturitriunghi.cpp:2:1: error: stray '\240' in program laturitriunghi.cpp:2:1: error: stray '\302' in program laturitriunghi.cpp:2:1: error: stray '\240' in program laturitriunghi.cpp:2:1: error: stray '\302' in program laturitriunghi.cpp:2:1: error: stray '\240' in program laturitriunghi.cpp:2:1: error: stray '\302' in program laturitriunghi.cpp:2:1: error: stray '\240' in program laturitriunghi.cpp:2:1: error: stray '\302' in program laturitriunghi.cpp:2:1: error: stray '\240' in program laturitriunghi.cpp:2:1: error: stray '\302' in program laturitriunghi.cpp:2:1: error: stray '\240' in program laturitriunghi.cpp:2:1: error: stray '\302' in program laturitriunghi.cpp:2:1: error: stray '\240' in program laturitriunghi.cpp:2:1: error: stray '\302' in program laturitriunghi.cpp:2:1: error: stray '\240' in program laturitriunghi.cpp:2:1: error: stray '\302' in program laturitriunghi.cpp:2:1: error: stray '\240' in program laturitriunghi.cpp:2:1: error: stray '\302' in program laturitriunghi.cpp:2:1: error: stray '\240' in program laturitriunghi.cpp:2:1: error: stray '\302' in program laturitriunghi.cpp:2:1: error: stray '\240' in program laturitriunghi.cpp:2:1: error: stray '\302' in program laturitriunghi.cpp:2:1: error: stray '\240' in program laturitriunghi.cpp:2:1: error: stray '\302' in program laturitriunghi.cpp:2:1: error: stray '\240' in program laturitriunghi.cpp:2:1: error: stray '\302' in program laturitriunghi.cpp:2:1: error: stray '\240' in program laturitriunghi.cpp:2:1: error: stray '\302' in program laturitriunghi.cpp:2:1: error: stray '\240' in program laturitriunghi.cpp:2:1: error: stray '\302' in program laturitriunghi.cpp:2:1: error: stray '\240' in program laturitriunghi.cpp:2:1: error: stray '\302' in program laturitriunghi.cpp:2:1: error: stray '\240' in program laturitriunghi.cpp:2:1: error: stray '\302' in program laturitriunghi.cpp:2:1: error: stray '\240' in program laturitriunghi.cpp:2:1: error: stray '\302' in program laturitriunghi.cpp:2:1: error: stray '\240' in program laturitriunghi.cpp:2:1: error: stray '\302' in program laturitriunghi.cpp:2:1: error: stray '\240' in program laturitriunghi.cpp:2:1: error: stray '\302' in program laturitriunghi.cpp:2:1: error: stray '\240' in program laturitriunghi.cpp:2:1: error: stray '\302' in program laturitriunghi.cpp:2:1: error: stray '\240' in program laturitriunghi.cpp:2:1: error: stray '\302' in program laturitriunghi.cpp:2:1: error: stray '\240' in program laturitriunghi.cpp:2:1: error: stray '\302' in program laturitriunghi.cpp:2:1: error: stray '\240' in program laturitriunghi.cpp:2:1: error: stray '\302' in program laturitriunghi.cpp:2:1: error: stray '\240' in program laturitriunghi.cpp:2:1: error: stray '\302' in program laturitriunghi.cpp:2:1: error: stray '\240' in program laturitriunghi.cpp:2:1: error: stray '\302' in program laturitriunghi.cpp:2:1: error: stray '\240' in program laturitriunghi.cpp:2:1: error: stray '\302' in program laturitriunghi.cpp:2:1: error: stray '\240' in program laturitriunghi.cpp:2:1: error: stray '\302' in program laturitriunghi.cpp:2:1: error: stray '\240' in program laturitriunghi.cpp:2:1: error: stray '\302' in program laturitriunghi.cpp:2:1: error: stray '\240' in program laturitriunghi.cpp:2:1: error: stray '\302' in program laturitriunghi.cpp:2:1: error: stray '\240' in program laturitriunghi.cpp:2:1: error: stray '\302' in program laturitriunghi.cpp:2:1: error: stray '\240' in program laturitriunghi.cpp:2:1: error: stray '\302' in program laturitriunghi.cpp:2:1: error: stray '\240' in program laturitriunghi.cpp:2:1: error: stray '\302' in program laturitriunghi.cpp:2:1: error: stray '\240' in program laturitriunghi.cpp:2:1: error: stray '\302' in program laturitriunghi.cpp:2:1: error: stray '\240' in program laturitriunghi.cpp:2:1: error: stray '\302' in program laturitriunghi.cpp:2:1: error: stray '\240' in program laturitriunghi.cpp:2:1: error: stray '\302' in program laturitriunghi.cpp:2:1: error: stray '\240' in program laturitriunghi.cpp:2:1: error: stray '\302' in program laturitriunghi.cpp:2:1: error: stray '\240' in program laturitriunghi.cpp:2:1: error: stray '\302' in program laturitriunghi.cpp:2:1: error: stray '\240' in program laturitriunghi.cpp:2:1: error: stray '\302' in program laturitriunghi.cpp:2:1: error: stray '\240' in program laturitriunghi.cpp:2:1: error: stray '\302' in program laturitriunghi.cpp:2:1: error: stray '\240' in program laturitriunghi.cpp:2:1: error: stray '\302' in program laturitriunghi.cpp:2:1: error: stray '\240' in program laturitriunghi.cpp:2:1: error: stray '\302' in program laturitriunghi.cpp:2:1: error: stray '\240' in program laturitriunghi.cpp:2:1: error: stray '\302' in program laturitriunghi.cpp:2:1: error: stray '\240' in program laturitriunghi.cpp:2:1: error: stray '\302' in program laturitriunghi.cpp:2:1: error: stray '\240' in program laturitriunghi.cpp:2:1: error: stray '\302' in program laturitriunghi.cpp:2:1: error: stray '\240' in program laturitriunghi.cpp:2:1: error: stray '\302' in program laturitriunghi.cpp:2:1: error: stray '\240' in program laturitriunghi.cpp:2:1: error: stray '\302' in program laturitriunghi.cpp:2:1: error: stray '\240' in program laturitriunghi.cpp:2:1: error: stray '\302' in program laturitriunghi.cpp:2:1: error: stray '\240' in program laturitriunghi.cpp:2:1: error: stray '\302' in program laturitriunghi.cpp:2:1: error: stray '\240' in program laturitriunghi.cpp:2:1: error: stray '\302' in program laturitriunghi.cpp:2:1: error: stray '\240' in program laturitriunghi.cpp:2:1: error: stray '\302' in program laturitriunghi.cpp:2:1: error: stray '\240' in program laturitriunghi.cpp:2:1: error: stray '\302' in program laturitriunghi.cpp:2:1: error: stray '\240' in program laturitriunghi.cpp:2:1: error: stray '\302' in program laturitriunghi.cpp:2:1: error: stray '\240' in program laturitriunghi.cpp: In function 'int main()': laturitriunghi.cpp:2:33: error: 'cin' was not declared in this scope int main(){ int n, i; cin>>n; for (i=1; i<n; i++) cout<<" "; cout<<"*"; for (i=1; i<n; i++) cout<<" "; cout<<endl; for (i=2; i<n; i++) { for (int j=1; j<=2*n-1; j++) if (i+j==n+1 || j-i==n-1) cout<<"*"; else cout<<" "; cout<<endl; } if (n>1) for (i=1; i<=n; i++) cout<<"* "; return 0;} ^ laturitriunghi.cpp:2:33: note: suggested alternative: In file included from laturitriunghi.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: 'std::cin' extern istream cin; /// Linked to standard input ^ laturitriunghi.cpp:2:77: error: 'cout' was not declared in this scope int main(){ int n, i; cin>>n; for (i=1; i<n; i++) cout<<" "; cout<<"*"; for (i=1; i<n; i++) cout<<" "; cout<<endl; for (i=2; i<n; i++) { for (int j=1; j<=2*n-1; j++) if (i+j==n+1 || j-i==n-1) cout<<"*"; else cout<<" "; cout<<endl; } if (n>1) for (i=1; i<=n; i++) cout<<"* "; return 0;} ^ laturitriunghi.cpp:2:77: note: suggested alternative: In file included from laturitriunghi.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: 'std::cout' extern ostream cout; /// Linked to standard output ^ laturitriunghi.cpp:2:93: error: 'cout' was not declared in this scope int main(){ int n, i; cin>>n; for (i=1; i<n; i++) cout<<" "; cout<<"*"; for (i=1; i<n; i++) cout<<" "; cout<<endl; for (i=2; i<n; i++) { for (int j=1; j<=2*n-1; j++) if (i+j==n+1 || j-i==n-1) cout<<"*"; else cout<<" "; cout<<endl; } if (n>1) for (i=1; i<=n; i++) cout<<"* "; return 0;} ^ laturitriunghi.cpp:2:93: note: suggested alternative: In file included from laturitriunghi.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: 'std::cout' extern ostream cout; /// Linked to standard output ^ laturitriunghi.cpp:2:162: error: 'endl' was not declared in this scope int main(){ int n, i; cin>>n; for (i=1; i<n; i++) cout<<" "; cout<<"*"; for (i=1; i<n; i++) cout<<" "; cout<<endl; for (i=2; i<n; i++) { for (int j=1; j<=2*n-1; j++) if (i+j==n+1 || j-i==n-1) cout<<"*"; else cout<<" "; cout<<endl; } if (n>1) for (i=1; i<=n; i++) cout<<"* "; return 0;} ^ laturitriunghi.cpp:2:162: note: suggested alternative: In file included from /usr/include/c++/4.8/iostream:39:0, from laturitriunghi.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 LaturiTriunghi 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ă.