Detalii evaluare #55120174

Rezumat problemă

Se dă un șir de caractere. Să se determine câte vocale din șir sunt cuprinse între două consoane.

Detalii

Problema Pozitii Operații I/O tastatură/ecran
Limita timp 0.1 secunde Limita memorie Total: 64 MB / Stivă 8 MB
Id soluție #55120174 Utilizator Deonise Alex (AlexDeonise)
Fișier pozitii.cpp Dimensiune 397 B
Data încărcării 27 Decembrie 2024, 11:43 Scor / rezultat Eroare de compilare

Evaluare


Mesaj compilare

pozitii.cpp:18:1: error: stray '\342' in program
 } ⁠
 ^
pozitii.cpp:18:1: error: stray '\200' in program
pozitii.cpp:18:1: error: stray '\257' in program
pozitii.cpp:18:1: error: stray '\342' in program
pozitii.cpp:18:1: error: stray '\201' in program
pozitii.cpp:18:1: error: stray '\240' in program
pozitii.cpp: In function 'int main()':
pozitii.cpp:6:40: error: array must be initialized with a brace-enclosed initializer
     int s[256], i, k = 0, consoane[] = "bcdfghjklmnpqrstvwxyz", vocale[] = "aeiou";

                                        ^
pozitii.cpp:6:76: error: array must be initialized with a brace-enclosed initializer
     int s[256], i, k = 0, consoane[] = "bcdfghjklmnpqrstvwxyz", vocale[] = "aeiou";

                                                                            ^
pozitii.cpp:7:18: error: no matching function for call to 'std::basic_istream<char>::get(int [256], int)'
     cin.get(s,255);

                  ^
pozitii.cpp:7:18: note: candidates are:
In file included from /usr/include/c++/4.8/sstream:38:0,
                 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 pozitii.cpp:1:
/usr/include/c++/4.8/istream:302:7: note: std::basic_istream<_CharT, _Traits>::int_type std::basic_istream<_CharT, _Traits>::get() [with _CharT = char; _Traits = std::char_traits<char>; std::basic_istream<_CharT, _Traits>::int_type = int]
       get();
       ^
/usr/include/c++/4.8/istream:302:7: note:   candidate expects 0 arguments, 2 provided
/usr/include/c++/4.8/istream:316:7: note: std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::get(std::basic_istream<_CharT, _Traits>::char_type&) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_istream<_CharT, _Traits>::char_type = char]
       get(char_type& __c);
       ^
/usr/include/c++/4.8/istream:316:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/4.8/istream:343:7: note: std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::get(std::basic_istream<_CharT, _Traits>::char_type*, std::streamsize, std::basic_istream<_CharT, _Traits>::char_type) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_istream<_CharT, _Traits>::char_type = char; std::streamsize = int]
       get(char_type* __s, streamsize __n, char_type __delim);
       ^
/usr/include/c++/4.8/istream:343:7: note:   candidate expects 3 arguments, 2 provided
/usr/include/c++/4.8/istream:354:7: note: std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::get(std::basic_istream<_CharT, _Traits>::char_type*, std::streamsize) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_istream<_CharT, _Traits>::__istream_type = std::basic_istream<char>; std::basic_istream<_CharT, _Traits>::char_type = char; std::streamsize = int]
       get(char_type* __s, streamsize __n)
       ^
/usr/include/c++/4.8/istream:354:7: note:   no known conversion for argument 1 from 'int [256]' to 'std::basic_istream<char>::char_type* {aka char*}'
/usr/include/c++/4.8/istream:377:7: note: std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::get(std::basic_istream<_CharT, _Traits>::__streambuf_type&, std::basic_istream<_CharT, _Traits>::char_type) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_istream<_CharT, _Traits>::__streambuf_type = std::basic_streambuf<char>; std::basic_istream<_CharT, _Traits>::char_type = char]
       get(__streambuf_type& __sb, char_type __delim);
       ^
/usr/include/c++/4.8/istream:377:7: note:   no known conversion for argument 1 from 'int [256]' to 'std::basic_istream<char>::__streambuf_type& {aka std::basic_streambuf<char>&}'
/usr/include/c++/4.8/istream:387:7: note: std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::get(std::basic_istream<_CharT, _Traits>::__streambuf_type&) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_istream<_CharT, _Traits>::__istream_type = std::basic_istream<char>; std::basic_istream<_CharT, _Traits>::__streambuf_type = std::basic_streambuf<char>]
       get(__streambuf_type& __sb)
       ^
/usr/include/c++/4.8/istream:387:7: note:   candidate expects 1 argument, 2 provided
pozitii.cpp:10:29: error: cannot convert 'int*' to 'const char*' for argument '1' to 'size_t strlen(const char*)'
     for(i = 2; i <= strlen(s)-1; i++)

                             ^
pozitii.cpp:11:35: error: no matching function for call to 'strchr(int [22], int&)'
         if(strchr(consoane, s[i-1]) && strchr(vocale, s[i]) && strchr(consoane, s[i+1]))

                                   ^
pozitii.cpp:11:35: note: candidates are:
In file included from /usr/include/c++/4.8/cstring:42:0,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:48,
                 from pozitii.cpp:1:
/usr/include/string.h:223:1: note: char* strchr(char*, int)
 strchr (char *__s, int __c) __THROW
 ^
/usr/include/string.h:223:1: note:   no known conversion for argument 1 from 'int [22]' to 'char*'
/usr/include/string.h:229:1: note: const char* strchr(const char*, int)
 strchr (const char *__s, int __c) __THROW
 ^
/usr/include/string.h:229:1: note:   no known conversion for argument 1 from 'int [22]' to 'const char*'
pozitii.cpp:11:59: error: no matching function for call to 'strchr(int [6], int&)'
         if(strchr(consoane, s[i-1]) && strchr(vocale, s[i]) && strchr(consoane, s[i+1]))

                                                           ^
pozitii.cpp:11:59: note: candidates are:
In file included from /usr/include/c++/4.8/cstring:42:0,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:48,
                 from pozitii.cpp:1:
/usr/include/string.h:223:1: note: char* strchr(char*, int)
 strchr (char *__s, int __c) __THROW
 ^
/usr/include/string.h:223:1: note:   no known conversion for argument 1 from 'int [6]' to 'char*'
/usr/include/string.h:229:1: note: const char* strchr(const char*, int)
 strchr (const char *__s, int __c) __THROW
 ^
/usr/include/string.h:229:1: note:   no known conversion for argument 1 from 'int [6]' to 'const char*'
pozitii.cpp:11:87: error: no matching function for call to 'strchr(int [22], int&)'
         if(strchr(consoane, s[i-1]) && strchr(vocale, s[i]) && strchr(consoane, s[i+1]))

                                                                                       ^
pozitii.cpp:11:87: note: candidates are:
In file included from /usr/include/c++/4.8/cstring:42:0,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:48,
                 from pozitii.cpp:1:
/usr/include/string.h:223:1: note: char* strchr(char*, int)
 strchr (char *__s, int __c) __THROW
 ^
/usr/include/string.h:223:1: note:   no known conversion for argument 1 from 'int [22]' to 'char*'
/usr/include/string.h:229:1: note: const char* strchr(const char*, int)
 strchr (const char *__s, int __c) __THROW
 ^
/usr/include/string.h:229:1: note:   no known conversion for argument 1 from 'int [22]' to 'const char*'

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