Detalii evaluare #11657211

Rezumat problemă

Se dă n. Afișați un triunghi cu latura de n steluțe gol înăuntru.

Detalii

Problema LaturiTriunghi Operații I/O tastatură/ecran
Limita timp 0.01 secunde Limita memorie Total: 10 MB / Stivă 2 MB
Id soluție #11657211 Utilizator Manaila Denisa (ManailaDenisa)
Fișier laturitriunghi.cpp Dimensiune 504 B
Data încărcării 05 Noiembrie 2018, 20:13 Scor / rezultat Eroare de compilare

Evaluare


Mesaj 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:3:1: error: stray '\302' in program
 {    

 ^
laturitriunghi.cpp:3:1: error: stray '\240' in program
laturitriunghi.cpp:3:1: error: stray '\302' in program
laturitriunghi.cpp:3:1: error: stray '\240' in program
laturitriunghi.cpp:4:5: error: stray '\302' in program
     int n, i;  

     ^
laturitriunghi.cpp:4:5: error: stray '\240' in program
laturitriunghi.cpp:5:5: error: stray '\302' in program
     cin>>n;   

     ^
laturitriunghi.cpp:5:5: error: stray '\240' in program
laturitriunghi.cpp:5:5: error: stray '\302' in program
laturitriunghi.cpp:5:5: error: stray '\240' in program
laturitriunghi.cpp:6:5: error: stray '\302' in program
     for (i=1; i<n; i++)        cout<<" ";

     ^
laturitriunghi.cpp:6:5: error: stray '\240' in program
laturitriunghi.cpp:6:5: error: stray '\302' in program
laturitriunghi.cpp:6:5: error: stray '\240' in program
laturitriunghi.cpp:6:5: error: stray '\302' in program
laturitriunghi.cpp:6:5: error: stray '\240' in program
laturitriunghi.cpp:6:5: error: stray '\302' in program
laturitriunghi.cpp:6:5: error: stray '\240' in program
laturitriunghi.cpp:7:5: error: stray '\302' in program
     cout<<"*";    for (i=1; i<n; i++)        cout<<" ";   

     ^
laturitriunghi.cpp:7:5: error: stray '\240' in program
laturitriunghi.cpp:7:5: error: stray '\302' in program
laturitriunghi.cpp:7:5: error: stray '\240' in program
laturitriunghi.cpp:7:5: error: stray '\302' in program
laturitriunghi.cpp:7:5: error: stray '\240' in program
laturitriunghi.cpp:7:5: error: stray '\302' in program
laturitriunghi.cpp:7:5: error: stray '\240' in program
laturitriunghi.cpp:7:5: error: stray '\302' in program
laturitriunghi.cpp:7:5: error: stray '\240' in program
laturitriunghi.cpp:7:5: error: stray '\302' in program
laturitriunghi.cpp:7:5: error: stray '\240' in program
laturitriunghi.cpp:7:5: error: stray '\302' in program
laturitriunghi.cpp:7:5: error: stray '\240' in program
laturitriunghi.cpp:7:5: error: stray '\302' in program
laturitriunghi.cpp:7:5: error: stray '\240' in program
laturitriunghi.cpp:8:5: error: stray '\302' in program
     cout<<endl;    for (i=2; i<n; i++)

     ^
laturitriunghi.cpp:8:5: error: stray '\240' in program
laturitriunghi.cpp:8:5: error: stray '\302' in program
laturitriunghi.cpp:8:5: error: stray '\240' in program
laturitriunghi.cpp:9:5: error: stray '\302' in program
     {        for (int j=1; j<=2*n-1; j++)            if (i+j==n+1 || j-i==n-1) cout<<"*";

     ^
laturitriunghi.cpp:9:5: error: stray '\240' in program
laturitriunghi.cpp:9:5: error: stray '\302' in program
laturitriunghi.cpp:9:5: error: stray '\240' in program
laturitriunghi.cpp:9:5: error: stray '\302' in program
laturitriunghi.cpp:9:5: error: stray '\240' in program
laturitriunghi.cpp:9:5: error: stray '\302' in program
laturitriunghi.cpp:9:5: error: stray '\240' in program
laturitriunghi.cpp:9:5: error: stray '\302' in program
laturitriunghi.cpp:9:5: error: stray '\240' in program
laturitriunghi.cpp:9:5: error: stray '\302' in program
laturitriunghi.cpp:9:5: error: stray '\240' in program
laturitriunghi.cpp:9:5: error: stray '\302' in program
laturitriunghi.cpp:9:5: error: stray '\240' in program
laturitriunghi.cpp:9:5: error: stray '\302' in program
laturitriunghi.cpp:9:5: error: stray '\240' in program
laturitriunghi.cpp:9:5: error: stray '\302' in program
laturitriunghi.cpp:9:5: error: stray '\240' in program
laturitriunghi.cpp:9:5: error: stray '\302' in program
laturitriunghi.cpp:9:5: error: stray '\240' in program
laturitriunghi.cpp:10:9: error: stray '\302' in program
         else cout<<" ";        cout<<endl;    }    if (n>1)       for (i=1; i<=n; i++)          cout<<"* ";

         ^
laturitriunghi.cpp:10:9: error: stray '\240' in program
laturitriunghi.cpp:10:9: error: stray '\302' in program
laturitriunghi.cpp:10:9: error: stray '\240' in program
laturitriunghi.cpp:10:9: error: stray '\302' in program
laturitriunghi.cpp:10:9: error: stray '\240' in program
laturitriunghi.cpp:10:9: error: stray '\302' in program
laturitriunghi.cpp:10:9: error: stray '\240' in program
laturitriunghi.cpp:10:9: error: stray '\302' in program
laturitriunghi.cpp:10:9: error: stray '\240' in program
laturitriunghi.cpp:10:9: error: stray '\302' in program
laturitriunghi.cpp:10:9: error: stray '\240' in program
laturitriunghi.cpp:10:9: error: stray '\302' in program
laturitriunghi.cpp:10:9: error: stray '\240' in program
laturitriunghi.cpp:10:9: error: stray '\302' in program
laturitriunghi.cpp:10:9: error: stray '\240' in program
laturitriunghi.cpp:10:9: error: stray '\302' in program
laturitriunghi.cpp:10:9: error: stray '\240' in program
laturitriunghi.cpp:10:9: error: stray '\302' in program
laturitriunghi.cpp:10:9: error: stray '\240' in program
laturitriunghi.cpp:10:9: error: stray '\302' in program
laturitriunghi.cpp:10:9: error: stray '\240' in program
laturitriunghi.cpp:10:9: error: stray '\302' in program
laturitriunghi.cpp:10:9: error: stray '\240' in program
laturitriunghi.cpp:10:9: error: stray '\302' in program
laturitriunghi.cpp:10:9: error: stray '\240' in program
laturitriunghi.cpp:10:9: error: stray '\302' in program
laturitriunghi.cpp:10:9: error: stray '\240' in program
laturitriunghi.cpp:10:9: error: stray '\302' in program
laturitriunghi.cpp:10:9: error: stray '\240' in program
laturitriunghi.cpp:10:9: error: stray '\302' in program
laturitriunghi.cpp:10:9: error: stray '\240' in program
laturitriunghi.cpp:10:9: error: stray '\302' in program
laturitriunghi.cpp:10:9: error: stray '\240' in program
laturitriunghi.cpp: In function 'int main()':
laturitriunghi.cpp:5:5: error: 'cin' was not declared in this scope
     cin>>n;   

     ^
laturitriunghi.cpp:5:5: 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:6:36: error: 'cout' was not declared in this scope
     for (i=1; i<n; i++)        cout<<" ";

                                    ^
laturitriunghi.cpp:6:36: 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:7:5: error: 'cout' was not declared in this scope
     cout<<"*";    for (i=1; i<n; i++)        cout<<" ";   

     ^
laturitriunghi.cpp:7:5: 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:8:11: error: 'endl' was not declared in this scope
     cout<<endl;    for (i=2; i<n; i++)

           ^
laturitriunghi.cpp:8:11: 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)
     ^

Cum funcționează evaluarea?

www.pbinfo.ro permite evaluarea a două tipuri de probleme:

  • probleme la care rezolvarea presupune scrierea unui program complet
  • probleme la care rezolvarea presupune scrierea unei secvențe de program - câteva instrucțiuni, o listă de declarații, una sau mai multe funcții, etc.

Problema LaturiTriunghi face parte din prima categorie. Soluția propusă de tine va fi evaluată astfel:

  • Programul sursă este compilat folosind compilatorul corespunzător. Dacă în urma compilării se obțin erori sau avertismente, acestea sunt afișate în această pagină.
  • Dacă programul a fost compilat, executabilul obținut va fi rulat, furnizându-i-se unul sau mai multe seturi de date de intrare, în concordanță cu restricțiile specifice problemei. Pentru fiecare set de date se obține un anumit punctaj, în raport cu corectitudinea soluției tale.

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ă.