Detalii evaluare #54661552

Rezumat problemă

Se dă un șir de caractere în care cuvintele sunt formate din litere mici și mari ale alfabetului englez și sunt separate prin spații. Să se afișeze cuvintele în ordine descrescătoare după numărul de vocale și să se afișeze fiecare cuvânt pe câte o linie. Dacă două cuvinte au același număr de vocale atunci ele se vor ordona descrescător după lungime, iar dacă au aceeași lungime atunci se vor ordona lexicografic.

Detalii

Problema VocSortDesc Operații I/O tastatură/ecran
Limita timp 0.1 secunde Limita memorie Total: 64 MB / Stivă 8 MB
Id soluție #54661552 Utilizator Pavel Maria-Giulia (giulia888)
Fișier vocsortdesc.cpp Dimensiune 1.62 KB
Data încărcării 04 Decembrie 2024, 20:50 Scor / rezultat Eroare de compilare

Evaluare


Mesaj compilare

vocsortdesc.cpp: In function 'int main()':
vocsortdesc.cpp:28:16: error: invalid conversion from 'char*' to 'char' [-fpermissive]
         s2[n++]=p;

                ^
vocsortdesc.cpp:35:28: error: invalid conversion from 'char' to 'char*' [-fpermissive]
             if(nrvocale(s[i])<nrvocale(s[j]))

                            ^
vocsortdesc.cpp:5:5: error:   initializing argument 1 of 'int nrvocale(char*)' [-fpermissive]
 int nrvocale(char s[])

     ^
vocsortdesc.cpp:35:43: error: invalid conversion from 'char' to 'char*' [-fpermissive]
             if(nrvocale(s[i])<nrvocale(s[j]))

                                           ^
vocsortdesc.cpp:5:5: error:   initializing argument 1 of 'int nrvocale(char*)' [-fpermissive]
 int nrvocale(char s[])

     ^
vocsortdesc.cpp:38:32: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
                 strcpy(aux, s[i]);

                                ^
In file included from /usr/include/features.h:374:0,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/os_defines.h:39,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/c++config.h:426,
                 from /usr/include/c++/4.8/iostream:38,
                 from vocsortdesc.cpp:1:
/usr/include/i386-linux-gnu/bits/string3.h:102:1: error:   initializing argument 2 of 'char* strcpy(char*, const char*)' [-fpermissive]
 __NTH (strcpy (char *__restrict __dest, const char *__restrict __src))
 ^
vocsortdesc.cpp:39:27: error: invalid conversion from 'char' to 'char*' [-fpermissive]
                 strcpy(s[i], s[j]);

                           ^
In file included from /usr/include/features.h:374:0,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/os_defines.h:39,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/c++config.h:426,
                 from /usr/include/c++/4.8/iostream:38,
                 from vocsortdesc.cpp:1:
/usr/include/i386-linux-gnu/bits/string3.h:102:1: error:   initializing argument 1 of 'char* strcpy(char*, const char*)' [-fpermissive]
 __NTH (strcpy (char *__restrict __dest, const char *__restrict __src))
 ^
vocsortdesc.cpp:39:33: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
                 strcpy(s[i], s[j]);

                                 ^
In file included from /usr/include/features.h:374:0,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/os_defines.h:39,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/c++config.h:426,
                 from /usr/include/c++/4.8/iostream:38,
                 from vocsortdesc.cpp:1:
/usr/include/i386-linux-gnu/bits/string3.h:102:1: error:   initializing argument 2 of 'char* strcpy(char*, const char*)' [-fpermissive]
 __NTH (strcpy (char *__restrict __dest, const char *__restrict __src))
 ^
vocsortdesc.cpp:40:27: error: invalid conversion from 'char' to 'char*' [-fpermissive]
                 strcpy(s[j], aux);

                           ^
In file included from /usr/include/features.h:374:0,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/os_defines.h:39,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/c++config.h:426,
                 from /usr/include/c++/4.8/iostream:38,
                 from vocsortdesc.cpp:1:
/usr/include/i386-linux-gnu/bits/string3.h:102:1: error:   initializing argument 1 of 'char* strcpy(char*, const char*)' [-fpermissive]
 __NTH (strcpy (char *__restrict __dest, const char *__restrict __src))
 ^
vocsortdesc.cpp:42:28: error: invalid conversion from 'char' to 'char*' [-fpermissive]
             if(nrvocale(s[i])==nrvocale(s[j]))

                            ^
vocsortdesc.cpp:5:5: error:   initializing argument 1 of 'int nrvocale(char*)' [-fpermissive]
 int nrvocale(char s[])

     ^
vocsortdesc.cpp:42:44: error: invalid conversion from 'char' to 'char*' [-fpermissive]
             if(nrvocale(s[i])==nrvocale(s[j]))

                                            ^
vocsortdesc.cpp:5:5: error:   initializing argument 1 of 'int nrvocale(char*)' [-fpermissive]
 int nrvocale(char s[])

     ^
vocsortdesc.cpp:44:30: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
                 if(strlen(s[i])<strlen[j])

                              ^
In file included from /usr/include/c++/4.8/cstring:42:0,
                 from vocsortdesc.cpp:2:
/usr/include/string.h:399:15: error:   initializing argument 1 of 'size_t strlen(const char*)' [-fpermissive]
 extern size_t strlen (const char *__s)
               ^
vocsortdesc.cpp:44:41: warning: pointer to a function used in arithmetic [-Wpointer-arith]
                 if(strlen(s[i])<strlen[j])

                                         ^
vocsortdesc.cpp:44:41: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
vocsortdesc.cpp:47:41: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
                         strcpy(aux1, s[i]);

                                         ^
In file included from /usr/include/features.h:374:0,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/os_defines.h:39,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/c++config.h:426,
                 from /usr/include/c++/4.8/iostream:38,
                 from vocsortdesc.cpp:1:
/usr/include/i386-linux-gnu/bits/string3.h:102:1: error:   initializing argument 2 of 'char* strcpy(char*, const char*)' [-fpermissive]
 __NTH (strcpy (char *__restrict __dest, const char *__restrict __src))
 ^
vocsortdesc.cpp:48:35: error: invalid conversion from 'char' to 'char*' [-fpermissive]
                         strcpy(s[i], s[j]);

                                   ^
In file included from /usr/include/features.h:374:0,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/os_defines.h:39,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/c++config.h:426,
                 from /usr/include/c++/4.8/iostream:38,
                 from vocsortdesc.cpp:1:
/usr/include/i386-linux-gnu/bits/string3.h:102:1: error:   initializing argument 1 of 'char* strcpy(char*, const char*)' [-fpermissive]
 __NTH (strcpy (char *__restrict __dest, const char *__restrict __src))
 ^
vocsortdesc.cpp:48:41: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
                         strcpy(s[i], s[j]);

                                         ^
In file included from /usr/include/features.h:374:0,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/os_defines.h:39,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/c++config.h:426,
                 from /usr/include/c++/4.8/iostream:38,
                 from vocsortdesc.cpp:1:
/usr/include/i386-linux-gnu/bits/string3.h:102:1: error:   initializing argument 2 of 'char* strcpy(char*, const char*)' [-fpermissive]
 __NTH (strcpy (char *__restrict __dest, const char *__restrict __src))
 ^
vocsortdesc.cpp:49:35: error: invalid conversion from 'char' to 'char*' [-fpermissive]
                         strcpy(s[j], aux1);

                                   ^
In file included from /usr/include/features.h:374:0,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/os_defines.h:39,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/c++config.h:426,
                 from /usr/include/c++/4.8/iostream:38,
                 from vocsortdesc.cpp:1:
/usr/include/i386-linux-gnu/bits/string3.h:102:1: error:   initializing argument 1 of 'char* strcpy(char*, const char*)' [-fpermissive]
 __NTH (strcpy (char *__restrict __dest, const char *__restrict __src))
 ^
vocsortdesc.cpp:51:30: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
                 if(strlen(s[i])==strlen[j])

                              ^
In file included from /usr/include/c++/4.8/cstring:42:0,
                 from vocsortdesc.cpp:2:
/usr/include/string.h:399:15: error:   initializing argument 1 of 'size_t strlen(const char*)' [-fpermissive]
 extern size_t strlen (const char *__s)
               ^
vocsortdesc.cpp:51:42: warning: pointer to a function used in arithmetic [-Wpointer-arith]
                 if(strlen(s[i])==strlen[j])

                                          ^
vocsortdesc.cpp:51:42: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
vocsortdesc.cpp:53:34: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
                     if(strcmp(s[i], s[j])>0)

                                  ^
In file included from /usr/include/c++/4.8/cstring:42:0,
                 from vocsortdesc.cpp:2:
/usr/include/string.h:144:12: error:   initializing argument 1 of 'int strcmp(const char*, const char*)' [-fpermissive]
 extern int strcmp (const char *__s1, const char *__s2)
            ^
vocsortdesc.cpp:53:40: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
                     if(strcmp(s[i], s[j])>0)

                                        ^
In file included from /usr/include/c++/4.8/cstring:42:0,
                 from vocsortdesc.cpp:2:
/usr/include/string.h:144:12: error:   initializing argument 2 of 'int strcmp(const char*, const char*)' [-fpermissive]
 extern int strcmp (const char *__s1, const char *__s2)
            ^
vocsortdesc.cpp:56:41: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
                         strcpy(aux2, s[i]);

                                         ^
In file included from /usr/include/features.h:374:0,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/os_defines.h:39,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/c++config.h:426,
                 from /usr/include/c++/4.8/iostream:38,
                 from vocsortdesc.cpp:1:
/usr/include/i386-linux-gnu/bits/string3.h:102:1: error:   initializing argument 2 of 'char* strcpy(char*, const char*)' [-fpermissive]
 __NTH (strcpy (char *__restrict __dest, const char *__restrict __src))
 ^
vocsortdesc.cpp:57:35: error: invalid conversion from 'char' to 'char*' [-fpermissive]
                         strcpy(s[i], s[j]);

                                   ^
In file included from /usr/include/features.h:374:0,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/os_defines.h:39,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/c++config.h:426,
                 from /usr/include/c++/4.8/iostream:38,
                 from vocsortdesc.cpp:1:
/usr/include/i386-linux-gnu/bits/string3.h:102:1: error:   initializing argument 1 of 'char* strcpy(char*, const char*)' [-fpermissive]
 __NTH (strcpy (char *__restrict __dest, const char *__restrict __src))
 ^
vocsortdesc.cpp:57:41: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
                         strcpy(s[i], s[j]);

                                         ^
In file included from /usr/include/features.h:374:0,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/os_defines.h:39,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/c++config.h:426,
                 from /usr/include/c++/4.8/iostream:38,
                 from vocsortdesc.cpp:1:
/usr/include/i386-linux-gnu/bits/string3.h:102:1: error:   initializing argument 2 of 'char* strcpy(char*, const char*)' [-fpermissive]
 __NTH (strcpy (char *__restrict __dest, const char *__restrict __src))
 ^
vocsortdesc.cpp:58:35: error: invalid conversion from 'char' to 'char*' [-fpermissive]
                         strcpy(s[j], aux2);

                                   ^
In file included from /usr/include/features.h:374:0,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/os_defines.h:39,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/c++config.h:426,
                 from /usr/include/c++/4.8/iostream:38,
                 from vocsortdesc.cpp:1:
/usr/include/i386-linux-gnu/bits/string3.h:102:1: error:   initializing argument 1 of 'char* strcpy(char*, const char*)' [-fpermissive]
 __NTH (strcpy (char *__restrict __dest, const char *__restrict __src))
 ^

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