Detalii evaluare #57570717

Rezumat problemă

Parsare C++

#2081

Se citesc numere până când nu mai este niciun număr de citit. Se cere să se afișeze valoarea maximă dintre acestea.

Detalii

Problema Parsare Operații I/O parsare.in/parsare.out
Limita timp 0.7 secunde Limita memorie Total: 64 MB / Stivă 8 MB
Id soluție #57570717 Utilizator tudosa david (tudosadavid)
Fișier parsare.cpp Dimensiune 1.26 KB
Data încărcării 05 Aprilie 2025, 12:18 Scor / rezultat Eroare de compilare

Evaluare

Mesaj compilare

parsare.cpp:1:9: error: #include expects "FILENAME" or <FILENAME>
 #include&lt;fstream&gt;

         ^
parsare.cpp:16:1: error: stray '\310' in program
 Pentru a obține cele 100 puncte trebuie folosită metoda parsării datelor de intrare:

 ^
parsare.cpp:16:1: error: stray '\233' in program
parsare.cpp:16:1: error: stray '\304' in program
parsare.cpp:16:1: error: stray '\203' in program
parsare.cpp:16:1: error: stray '\304' in program
parsare.cpp:16:1: error: stray '\203' in program
parsare.cpp:17:10: error: #include expects "FILENAME" or <FILENAME>
 #include &lt;bits/stdc++.h&gt;

          ^
parsare.cpp:29:11: error: stray '#' in program
 if (c == &#39;-&#39;)

           ^
parsare.cpp:29:17: error: stray '#' in program
 if (c == &#39;-&#39;)

                 ^
parsare.cpp:34:12: error: stray '#' in program
 if (c&gt;=&#39;0&#39; &amp;&amp; c&lt;=&#39;9&#39;)

            ^
parsare.cpp:34:18: error: stray '#' in program
 if (c&gt;=&#39;0&#39; &amp;&amp; c&lt;=&#39;9&#39;)

                  ^
parsare.cpp:34:41: error: stray '#' in program
 if (c&gt;=&#39;0&#39; &amp;&amp; c&lt;=&#39;9&#39;)

                                         ^
parsare.cpp:34:47: error: stray '#' in program
 if (c&gt;=&#39;0&#39; &amp;&amp; c&lt;=&#39;9&#39;)

                                               ^
parsare.cpp:36:16: error: stray '#' in program
 raspuns = c - &#39;0&#39;;

                ^
parsare.cpp:36:22: error: stray '#' in program
 raspuns = c - &#39;0&#39;;

                      ^
parsare.cpp:44:11: error: stray '#' in program
 if (c&lt;&#39;0&#39; || c&gt;&#39;9&#39;) break;

           ^
parsare.cpp:44:17: error: stray '#' in program
 if (c&lt;&#39;0&#39; || c&gt;&#39;9&#39;) break;

                 ^
parsare.cpp:44:31: error: stray '#' in program
 if (c&lt;&#39;0&#39; || c&gt;&#39;9&#39;) break;

                               ^
parsare.cpp:44:37: error: stray '#' in program
 if (c&lt;&#39;0&#39; || c&gt;&#39;9&#39;) break;

                                     ^
parsare.cpp:45:27: error: stray '#' in program
 raspuns = 10*raspuns + c-&#39;0&#39;;

                           ^
parsare.cpp:45:33: error: stray '#' in program
 raspuns = 10*raspuns + c-&#39;0&#39;;

                                 ^
parsare.cpp:3:1: error: 'ifstream' does not name a type
 ifstream fin(&quot;parsare.in&quot;);

 ^
parsare.cpp:3:20: error: 'parsare' does not name a type
 ifstream fin(&quot;parsare.in&quot;);

                    ^
parsare.cpp:3:36: error: expected unqualified-id before ')' token
 ifstream fin(&quot;parsare.in&quot;);

                                    ^
parsare.cpp:4:1: error: 'ofstream' does not name a type
 ofstream fout(&quot;parsare.out&quot;);

 ^
parsare.cpp:4:21: error: 'parsare' does not name a type
 ofstream fout(&quot;parsare.out&quot;);

                     ^
parsare.cpp:4:38: error: expected unqualified-id before ')' token
 ofstream fout(&quot;parsare.out&quot;);

                                      ^
parsare.cpp: In function 'int main()':
parsare.cpp:9:7: error: 'fin' was not declared in this scope
 while(fin&gt;&gt;x)

       ^
parsare.cpp:9:11: error: 'gt' was not declared in this scope
 while(fin&gt;&gt;x)

           ^
parsare.cpp:9:13: error: expected ')' before ';' token
 while(fin&gt;&gt;x)

             ^
parsare.cpp:9:15: error: 'gt' was not declared in this scope
 while(fin&gt;&gt;x)

               ^
parsare.cpp:9:19: error: expected ';' before ')' token
 while(fin&gt;&gt;x)

                   ^
parsare.cpp:10:8: warning: statement has no effect [-Wunused-value]
 if(x&gt;maxx)

        ^
parsare.cpp:10:13: error: expected ';' before ')' token
 if(x&gt;maxx)

             ^
parsare.cpp:11:7: warning: statement has no effect [-Wunused-value]
 maxx=x;

       ^
parsare.cpp:12:1: error: 'fout' was not declared in this scope
 fout&lt;&lt;maxx;

 ^
parsare.cpp:12:6: error: 'lt' was not declared in this scope
 fout&lt;&lt;maxx;

      ^
parsare.cpp:12:17: warning: statement has no effect [-Wunused-value]
 fout&lt;&lt;maxx;

                 ^
parsare.cpp: At global scope:
parsare.cpp:16:1: error: 'Pentru' does not name a type
 Pentru a obține cele 100 puncte trebuie folosită metoda parsării datelor de intrare:

 ^
parsare.cpp: In function 'int citireInt()':
parsare.cpp:27:13: error: 'getchar' was not declared in this scope
 c = getchar();

             ^
parsare.cpp:28:10: error: 'EOF' was not declared in this scope
 if (c == EOF) return 100001;

          ^
parsare.cpp:29:12: error: lvalue required as unary '&' operand
 if (c == &#39;-&#39;)

            ^
parsare.cpp:29:14: error: expected ')' before ';' token
 if (c == &#39;-&#39;)

              ^
parsare.cpp:29:18: error: lvalue required as unary '&' operand
 if (c == &#39;-&#39;)

                  ^
parsare.cpp:29:21: error: expected primary-expression before ')' token
 if (c == &#39;-&#39;)

                     ^
parsare.cpp:29:21: error: expected ';' before ')' token
parsare.cpp:34:7: error: 'gt' was not declared in this scope
 if (c&gt;=&#39;0&#39; &amp;&amp; c&lt;=&#39;9&#39;)

       ^
parsare.cpp:34:9: error: expected ')' before ';' token
 if (c&gt;=&#39;0&#39; &amp;&amp; c&lt;=&#39;9&#39;)

         ^
parsare.cpp:34:10: error: expected primary-expression before '=' token
 if (c&gt;=&#39;0&#39; &amp;&amp; c&lt;=&#39;9&#39;)

          ^
parsare.cpp:34:13: error: lvalue required as unary '&' operand
 if (c&gt;=&#39;0&#39; &amp;&amp; c&lt;=&#39;9&#39;)

             ^
parsare.cpp:34:21: warning: statement has no effect [-Wunused-value]
 if (c&gt;=&#39;0&#39; &amp;&amp; c&lt;=&#39;9&#39;)

                     ^
parsare.cpp:34:24: error: 'amp' was not declared in this scope
 if (c&gt;=&#39;0&#39; &amp;&amp; c&lt;=&#39;9&#39;)

                        ^
parsare.cpp:34:36: error: 'lt' was not declared in this scope
 if (c&gt;=&#39;0&#39; &amp;&amp; c&lt;=&#39;9&#39;)

                                    ^
parsare.cpp:34:39: error: expected primary-expression before '=' token
 if (c&gt;=&#39;0&#39; &amp;&amp; c&lt;=&#39;9&#39;)

                                       ^
parsare.cpp:34:42: error: lvalue required as unary '&' operand
 if (c&gt;=&#39;0&#39; &amp;&amp; c&lt;=&#39;9&#39;)

                                          ^
parsare.cpp:34:50: warning: statement has no effect [-Wunused-value]
 if (c&gt;=&#39;0&#39; &amp;&amp; c&lt;=&#39;9&#39;)

                                                  ^
parsare.cpp:34:51: error: expected primary-expression before ')' token
 if (c&gt;=&#39;0&#39; &amp;&amp; c&lt;=&#39;9&#39;)

                                                   ^
parsare.cpp:34:51: error: expected ';' before ')' token
parsare.cpp:43:13: error: 'getchar' was not declared in this scope
 c = getchar();

             ^
parsare.cpp:44:7: error: 'lt' was not declared in this scope
 if (c&lt;&#39;0&#39; || c&gt;&#39;9&#39;) break;

       ^
parsare.cpp:44:9: error: expected ')' before ';' token
 if (c&lt;&#39;0&#39; || c&gt;&#39;9&#39;) break;

         ^
parsare.cpp:44:12: error: lvalue required as unary '&' operand
 if (c&lt;&#39;0&#39; || c&gt;&#39;9&#39;) break;

            ^
parsare.cpp:44:20: warning: statement has no effect [-Wunused-value]
 if (c&lt;&#39;0&#39; || c&gt;&#39;9&#39;) break;

                    ^
parsare.cpp:44:22: error: expected primary-expression before '||' token
 if (c&lt;&#39;0&#39; || c&gt;&#39;9&#39;) break;

                      ^
parsare.cpp:44:27: error: 'gt' was not declared in this scope
 if (c&lt;&#39;0&#39; || c&gt;&#39;9&#39;) break;

                           ^
parsare.cpp:44:32: error: lvalue required as unary '&' operand
 if (c&lt;&#39;0&#39; || c&gt;&#39;9&#39;) break;

                                ^
parsare.cpp:44:40: warning: statement has no effect [-Wunused-value]
 if (c&lt;&#39;0&#39; || c&gt;&#39;9&#39;) break;

                                        ^
parsare.cpp:44:41: error: expected primary-expression before ')' token
 if (c&lt;&#39;0&#39; || c&gt;&#39;9&#39;) break;

                                         ^
parsare.cpp:44:41: error: expected ';' before ')' token
parsare.cpp:45:28: error: lvalue required as unary '&' operand
 raspuns = 10*raspuns + c-&#39;0&#39;;

                            ^
parsare.cpp:45:36: warning: statement has no effect [-Wunused-value]
 raspuns = 10*raspuns + c-&#39;0&#39;;

                                    ^
parsare.cpp: In function 'int main()':
parsare.cpp:50:5: error: redefinition of 'int main()'
 int main()

     ^
parsare.cpp:6:5: error: 'int main()' previously defined here
 int main()

     ^
parsare.cpp:53:11: error: 'quot' was not declared in this scope
 freopen (&quot;parsare.in&quot;, &quot;r&quot;, stdin);

           ^
parsare.cpp:53:16: error: 'parsare' was not declared in this scope
 freopen (&quot;parsare.in&quot;, &quot;r&quot;, stdin);

                ^
parsare.cpp:53:32: error: expected primary-expression before ',' token
 freopen (&quot;parsare.in&quot;, &quot;r&quot;, stdin);

                                ^
parsare.cpp:53:40: error: 'r' was not declared in this scope
 freopen (&quot;parsare.in&quot;, &quot;r&quot;, stdin);

                                        ^
parsare.cpp:53:47: error: expected primary-expression before ',' token
 freopen (&quot;parsare.in&quot;, &quot;r&quot;, stdin);

                                               ^
parsare.cpp:53:49: error: 'stdin' was not declared in this scope
 freopen (&quot;parsare.in&quot;, &quot;r&quot;, stdin);

                                                 ^
parsare.cpp:53:54: error: expected ';' before ')' token
 freopen (&quot;parsare.in&quot;, &quot;r&quot;, stdin);

                                                      ^
parsare.cpp:54:33: error: expected primary-expression before ',' token
 freopen (&quot;parsare.out&quot;, &quot;w&quot;, stdout);

                                 ^
parsare.cpp:54:41: error: 'w' was not declared in this scope
 freopen (&quot;parsare.out&quot;, &quot;w&quot;, stdout);

                                         ^
parsare.cpp:54:48: error: expected primary-expression before ',' token
 freopen (&quot;parsare.out&quot;, &quot;w&quot;, stdout);

                                                ^
parsare.cpp:54:50: error: 'stdout' was not declared in this scope
 freopen (&quot;parsare.out&quot;, &quot;w&quot;, stdout);

                                                  ^
parsare.cpp:54:56: error: expected ';' before ')' token
 freopen (&quot;parsare.out&quot;, &quot;w&quot;, stdout);

                                                        ^
parsare.cpp:60:1: error: 'cout' was not declared in this scope
 cout &lt;&lt; maxim;

 ^
parsare.cpp:60:7: error: 'lt' was not declared in this scope
 cout &lt;&lt; maxim;

       ^
parsare.cpp:60:20: warning: statement has no effect [-Wunused-value]
 cout &lt;&lt; maxim;

                    ^
parsare.cpp:63:21: error: 'max' was not declared in this scope
 maxim = max(maxim, x);

                     ^

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

Du-te sus!