Detalii evaluare #6954598

Rezumat problemă

Se dă un text în care cuvintele sunt formate din litere mici ale alfabetului englez şi cifre şi sunt separate prin spaţii şi semne de punctuaţie. Să se determine perechea de vocale alăturate din text care apare de cele mai multe ori.

Detalii

Problema PerechiVocale1 Operații I/O perechivocale1.in/perechivocale1.out
Limita timp 0.1 secunde Limita memorie Total: 64 MB / Stivă 8 MB
Id soluție #6954598 Utilizator marisa petre (marisamm)
Fișier perechivocale1.cpp Dimensiune 743 B
Data încărcării 16 Noiembrie 2017, 19:54 Scor / rezultat Eroare de compilare

Evaluare


Mesaj compilare

perechivocale1.cpp:1:19: warning: extra tokens at end of #include directive [enabled by default]
 #include <stdio.h>#include <cstring>using namespace std;FILE *in=fopen("perechivocale1.in","r");FILE *out=fopen("perechivocale1.out","w");int n,a[5][5],ma,i,j;char c1,c2,s[]="aeiou";

                   ^
perechivocale1.cpp:1:28: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix]
 #include <stdio.h>#include <cstring>using namespace std;FILE *in=fopen("perechivocale1.in","r");FILE *out=fopen("perechivocale1.out","w");int n,a[5][5],ma,i,j;char c1,c2,s[]="aeiou";

                            ^
perechivocale1.cpp: In function 'int main()':
perechivocale1.cpp:3:23: error: 'in' was not declared in this scope
 int main(){    fscanf(in,"%c",&c1);    while(!feof(in))    {        i=pozsir(s,c1);        fscanf(in,"%c",&c2);        j=pozsir(s,c2);        if(i!=j&&i<5&&j<5)            a[i][j]++;        c1=c2;    }    for(i=0;i<5;i++)        for(j=0;j<5;j++)            if(ma<a[i][j])                ma=a[i][j];    for(i=0;i<5;i++)        for(j=0;j<5;j++)            if(ma==a[i][j])                fprintf(out,"%c%c ",s[i],s[j]);    return 0;}
                       ^
perechivocale1.cpp:3:32: error: 'c1' was not declared in this scope
 int main(){    fscanf(in,"%c",&c1);    while(!feof(in))    {        i=pozsir(s,c1);        fscanf(in,"%c",&c2);        j=pozsir(s,c2);        if(i!=j&&i<5&&j<5)            a[i][j]++;        c1=c2;    }    for(i=0;i<5;i++)        for(j=0;j<5;j++)            if(ma<a[i][j])                ma=a[i][j];    for(i=0;i<5;i++)        for(j=0;j<5;j++)            if(ma==a[i][j])                fprintf(out,"%c%c ",s[i],s[j]);    return 0;}
                                ^
perechivocale1.cpp:3:69: error: 'i' was not declared in this scope
 int main(){    fscanf(in,"%c",&c1);    while(!feof(in))    {        i=pozsir(s,c1);        fscanf(in,"%c",&c2);        j=pozsir(s,c2);        if(i!=j&&i<5&&j<5)            a[i][j]++;        c1=c2;    }    for(i=0;i<5;i++)        for(j=0;j<5;j++)            if(ma<a[i][j])                ma=a[i][j];    for(i=0;i<5;i++)        for(j=0;j<5;j++)            if(ma==a[i][j])                fprintf(out,"%c%c ",s[i],s[j]);    return 0;}
                                                                     ^
perechivocale1.cpp:3:78: error: 's' was not declared in this scope
 int main(){    fscanf(in,"%c",&c1);    while(!feof(in))    {        i=pozsir(s,c1);        fscanf(in,"%c",&c2);        j=pozsir(s,c2);        if(i!=j&&i<5&&j<5)            a[i][j]++;        c1=c2;    }    for(i=0;i<5;i++)        for(j=0;j<5;j++)            if(ma<a[i][j])                ma=a[i][j];    for(i=0;i<5;i++)        for(j=0;j<5;j++)            if(ma==a[i][j])                fprintf(out,"%c%c ",s[i],s[j]);    return 0;}
                                                                              ^
perechivocale1.cpp:3:108: error: 'c2' was not declared in this scope
 int main(){    fscanf(in,"%c",&c1);    while(!feof(in))    {        i=pozsir(s,c1);        fscanf(in,"%c",&c2);        j=pozsir(s,c2);        if(i!=j&&i<5&&j<5)            a[i][j]++;        c1=c2;    }    for(i=0;i<5;i++)        for(j=0;j<5;j++)            if(ma<a[i][j])                ma=a[i][j];    for(i=0;i<5;i++)        for(j=0;j<5;j++)            if(ma==a[i][j])                fprintf(out,"%c%c ",s[i],s[j]);    return 0;}
                                                                                                            ^
perechivocale1.cpp:3:120: error: 'j' was not declared in this scope
 int main(){    fscanf(in,"%c",&c1);    while(!feof(in))    {        i=pozsir(s,c1);        fscanf(in,"%c",&c2);        j=pozsir(s,c2);        if(i!=j&&i<5&&j<5)            a[i][j]++;        c1=c2;    }    for(i=0;i<5;i++)        for(j=0;j<5;j++)            if(ma<a[i][j])                ma=a[i][j];    for(i=0;i<5;i++)        for(j=0;j<5;j++)            if(ma==a[i][j])                fprintf(out,"%c%c ",s[i],s[j]);    return 0;}
                                                                                                                        ^
perechivocale1.cpp:3:173: error: 'a' was not declared in this scope
 int main(){    fscanf(in,"%c",&c1);    while(!feof(in))    {        i=pozsir(s,c1);        fscanf(in,"%c",&c2);        j=pozsir(s,c2);        if(i!=j&&i<5&&j<5)            a[i][j]++;        c1=c2;    }    for(i=0;i<5;i++)        for(j=0;j<5;j++)            if(ma<a[i][j])                ma=a[i][j];    for(i=0;i<5;i++)        for(j=0;j<5;j++)            if(ma==a[i][j])                fprintf(out,"%c%c ",s[i],s[j]);    return 0;}
                                                                                                                                                                             ^
perechivocale1.cpp:3:210: error: 'i' was not declared in this scope
 int main(){    fscanf(in,"%c",&c1);    while(!feof(in))    {        i=pozsir(s,c1);        fscanf(in,"%c",&c2);        j=pozsir(s,c2);        if(i!=j&&i<5&&j<5)            a[i][j]++;        c1=c2;    }    for(i=0;i<5;i++)        for(j=0;j<5;j++)            if(ma<a[i][j])                ma=a[i][j];    for(i=0;i<5;i++)        for(j=0;j<5;j++)            if(ma==a[i][j])                fprintf(out,"%c%c ",s[i],s[j]);    return 0;}
                                                                                                                                                                                                                  ^
perechivocale1.cpp:3:234: error: 'j' was not declared in this scope
 int main(){    fscanf(in,"%c",&c1);    while(!feof(in))    {        i=pozsir(s,c1);        fscanf(in,"%c",&c2);        j=pozsir(s,c2);        if(i!=j&&i<5&&j<5)            a[i][j]++;        c1=c2;    }    for(i=0;i<5;i++)        for(j=0;j<5;j++)            if(ma<a[i][j])                ma=a[i][j];    for(i=0;i<5;i++)        for(j=0;j<5;j++)            if(ma==a[i][j])                fprintf(out,"%c%c ",s[i],s[j]);    return 0;}
                                                                                                                                                                                                                                          ^
perechivocale1.cpp:3:261: error: 'ma' was not declared in this scope
 int main(){    fscanf(in,"%c",&c1);    while(!feof(in))    {        i=pozsir(s,c1);        fscanf(in,"%c",&c2);        j=pozsir(s,c2);        if(i!=j&&i<5&&j<5)            a[i][j]++;        c1=c2;    }    for(i=0;i<5;i++)        for(j=0;j<5;j++)            if(ma<a[i][j])                ma=a[i][j];    for(i=0;i<5;i++)        for(j=0;j<5;j++)            if(ma==a[i][j])                fprintf(out,"%c%c ",s[i],s[j]);    return 0;}
                                                                                                                                                                                                                                                                     ^
perechivocale1.cpp:3:264: error: 'a' was not declared in this scope
 int main(){    fscanf(in,"%c",&c1);    while(!feof(in))    {        i=pozsir(s,c1);        fscanf(in,"%c",&c2);        j=pozsir(s,c2);        if(i!=j&&i<5&&j<5)            a[i][j]++;        c1=c2;    }    for(i=0;i<5;i++)        for(j=0;j<5;j++)            if(ma<a[i][j])                ma=a[i][j];    for(i=0;i<5;i++)        for(j=0;j<5;j++)            if(ma==a[i][j])                fprintf(out,"%c%c ",s[i],s[j]);    return 0;}
                                                                                                                                                                                                                                                                        ^
perechivocale1.cpp:3:307: error: 'i' was not declared in this scope
 int main(){    fscanf(in,"%c",&c1);    while(!feof(in))    {        i=pozsir(s,c1);        fscanf(in,"%c",&c2);        j=pozsir(s,c2);        if(i!=j&&i<5&&j<5)            a[i][j]++;        c1=c2;    }    for(i=0;i<5;i++)        for(j=0;j<5;j++)            if(ma<a[i][j])                ma=a[i][j];    for(i=0;i<5;i++)        for(j=0;j<5;j++)            if(ma==a[i][j])                fprintf(out,"%c%c ",s[i],s[j]);    return 0;}
                                                                                                                                                                                                                                                                                                                   ^
perechivocale1.cpp:3:331: error: 'j' was not declared in this scope
 int main(){    fscanf(in,"%c",&c1);    while(!feof(in))    {        i=pozsir(s,c1);        fscanf(in,"%c",&c2);        j=pozsir(s,c2);        if(i!=j&&i<5&&j<5)            a[i][j]++;        c1=c2;    }    for(i=0;i<5;i++)        for(j=0;j<5;j++)            if(ma<a[i][j])                ma=a[i][j];    for(i=0;i<5;i++)        for(j=0;j<5;j++)            if(ma==a[i][j])                fprintf(out,"%c%c ",s[i],s[j]);    return 0;}
                                                                                                                                                                                                                                                                                                                                           ^
perechivocale1.cpp:3:358: error: 'ma' was not declared in this scope
 int main(){    fscanf(in,"%c",&c1);    while(!feof(in))    {        i=pozsir(s,c1);        fscanf(in,"%c",&c2);        j=pozsir(s,c2);        if(i!=j&&i<5&&j<5)            a[i][j]++;        c1=c2;    }    for(i=0;i<5;i++)        for(j=0;j<5;j++)            if(ma<a[i][j])                ma=a[i][j];    for(i=0;i<5;i++)        for(j=0;j<5;j++)            if(ma==a[i][j])                fprintf(out,"%c%c ",s[i],s[j]);    return 0;}
                                                                                                                                                                                                                                                                                                                                                                      ^
perechivocale1.cpp:3:362: error: 'a' was not declared in this scope
 int main(){    fscanf(in,"%c",&c1);    while(!feof(in))    {        i=pozsir(s,c1);        fscanf(in,"%c",&c2);        j=pozsir(s,c2);        if(i!=j&&i<5&&j<5)            a[i][j]++;        c1=c2;    }    for(i=0;i<5;i++)        for(j=0;j<5;j++)            if(ma<a[i][j])                ma=a[i][j];    for(i=0;i<5;i++)        for(j=0;j<5;j++)            if(ma==a[i][j])                fprintf(out,"%c%c ",s[i],s[j]);    return 0;}
                                                                                                                                                                                                                                                                                                                                                                          ^
perechivocale1.cpp:3:394: error: 'out' was not declared in this scope
 int main(){    fscanf(in,"%c",&c1);    while(!feof(in))    {        i=pozsir(s,c1);        fscanf(in,"%c",&c2);        j=pozsir(s,c2);        if(i!=j&&i<5&&j<5)            a[i][j]++;        c1=c2;    }    for(i=0;i<5;i++)        for(j=0;j<5;j++)            if(ma<a[i][j])                ma=a[i][j];    for(i=0;i<5;i++)        for(j=0;j<5;j++)            if(ma==a[i][j])                fprintf(out,"%c%c ",s[i],s[j]);    return 0;}
                                                                                                                                                                                                                                                                                                                                                                                                          ^
perechivocale1.cpp:3:406: error: 's' was not declared in this scope
 int main(){    fscanf(in,"%c",&c1);    while(!feof(in))    {        i=pozsir(s,c1);        fscanf(in,"%c",&c2);        j=pozsir(s,c2);        if(i!=j&&i<5&&j<5)            a[i][j]++;        c1=c2;    }    for(i=0;i<5;i++)        for(j=0;j<5;j++)            if(ma<a[i][j])                ma=a[i][j];    for(i=0;i<5;i++)        for(j=0;j<5;j++)            if(ma==a[i][j])                fprintf(out,"%c%c ",s[i],s[j]);    return 0;}
                                                                                                                                                                                                                                                                                                                                                                                                                      ^

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