Detalii evaluare #9156745

Rezumat problemă

Scrieți un program care citeşte o valoare naturală impară pentru n şi apoi generează şi afişează în ordine crescătoare lexicografic toate combinaţiile formate din n litere mici care îndeplinesc următoarele proprietăţi:

- încep şi se termină cu a;
- oricare două litere alăturate dintr-o combinaţie sunt consecutive în alfabet.

Detalii

Problema LitereGen1 Operații I/O tastatură/ecran
Limita timp 0.4 secunde Limita memorie Total: 64 MB / Stivă 8 MB
Id soluție #9156745 Utilizator Ciobancan Andrei (AndreiOctavian)
Fișier literegen1.cpp Dimensiune 1.65 KB
Data încărcării 12 Aprilie 2018, 21:27 Scor / rezultat Eroare de compilare

Evaluare


Mesaj compilare

literegen1.cpp:8:1: error: stray '\302' in program
 {   

 ^
literegen1.cpp:8:1: error: stray '\240' in program
literegen1.cpp:8:1: error: stray '\302' in program
literegen1.cpp:8:1: error: stray '\240' in program
literegen1.cpp:12:1: error: stray '\302' in program
 {    

 ^
literegen1.cpp:12:1: error: stray '\240' in program
literegen1.cpp:12:1: error: stray '\302' in program
literegen1.cpp:12:1: error: stray '\240' in program
literegen1.cpp:14:9: error: stray '\302' in program
         return 1; 

         ^
literegen1.cpp:14:9: error: stray '\240' in program
literegen1.cpp:15:5: error: stray '\302' in program
     else        

     ^
literegen1.cpp:15:5: error: stray '\240' in program
literegen1.cpp:15:5: error: stray '\302' in program
literegen1.cpp:15:5: error: stray '\240' in program
literegen1.cpp:15:5: error: stray '\302' in program
literegen1.cpp:15:5: error: stray '\240' in program
literegen1.cpp:15:5: error: stray '\302' in program
literegen1.cpp:15:5: error: stray '\240' in program
literegen1.cpp:19:1: error: stray '\302' in program
 {    if(k==1&&abs(x[k]-2)!=1)  

 ^
literegen1.cpp:19:1: error: stray '\240' in program
literegen1.cpp:19:1: error: stray '\302' in program
literegen1.cpp:19:1: error: stray '\240' in program
literegen1.cpp:19:1: error: stray '\302' in program
literegen1.cpp:19:1: error: stray '\240' in program
literegen1.cpp:20:5: error: stray '\302' in program
     return 0;   

     ^
literegen1.cpp:20:5: error: stray '\240' in program
literegen1.cpp:20:5: error: stray '\302' in program
literegen1.cpp:20:5: error: stray '\240' in program
literegen1.cpp:21:2: error: stray '\302' in program
  if(k==p&&abs(x[k]-2)!=1) 

  ^
literegen1.cpp:21:2: error: stray '\240' in program
literegen1.cpp:22:6: error: stray '\302' in program
      return 0;   

      ^
literegen1.cpp:22:6: error: stray '\240' in program
literegen1.cpp:22:6: error: stray '\302' in program
literegen1.cpp:22:6: error: stray '\240' in program
literegen1.cpp:23:2: error: stray '\302' in program
  for(int i=2;i<=k;++i)  

  ^
literegen1.cpp:23:2: error: stray '\240' in program
literegen1.cpp:24:6: error: stray '\302' in program
      if(abs(x[i]-x[i-1])!=1)   

      ^
literegen1.cpp:24:6: error: stray '\240' in program
literegen1.cpp:24:6: error: stray '\302' in program
literegen1.cpp:24:6: error: stray '\240' in program
literegen1.cpp:25:6: error: stray '\302' in program
      return 0;    return 1;}

      ^
literegen1.cpp:25:6: error: stray '\240' in program
literegen1.cpp:25:6: error: stray '\302' in program
literegen1.cpp:25:6: error: stray '\240' in program
literegen1.cpp:27:1: error: stray '\302' in program
 {    

 ^
literegen1.cpp:27:1: error: stray '\240' in program
literegen1.cpp:27:1: error: stray '\302' in program
literegen1.cpp:27:1: error: stray '\240' in program
literegen1.cpp:28:5: error: stray '\302' in program
     if(k==p+1)    

     ^
literegen1.cpp:28:5: error: stray '\240' in program
literegen1.cpp:28:5: error: stray '\302' in program
literegen1.cpp:28:5: error: stray '\240' in program
literegen1.cpp:29:9: error: stray '\302' in program
         return 1; 

         ^
literegen1.cpp:29:9: error: stray '\240' in program
literegen1.cpp:30:5: error: stray '\302' in program
     else        

     ^
literegen1.cpp:30:5: error: stray '\240' in program
literegen1.cpp:30:5: error: stray '\302' in program
literegen1.cpp:30:5: error: stray '\240' in program
literegen1.cpp:30:5: error: stray '\302' in program
literegen1.cpp:30:5: error: stray '\240' in program
literegen1.cpp:30:5: error: stray '\302' in program
literegen1.cpp:30:5: error: stray '\240' in program
literegen1.cpp:34:1: error: stray '\302' in program
 {    a[nr][0]='0',a[nr][1]='1';

 ^
literegen1.cpp:34:1: error: stray '\240' in program
literegen1.cpp:34:1: error: stray '\302' in program
literegen1.cpp:34:1: error: stray '\240' in program
literegen1.cpp:35:2: error: stray '\302' in program
  for(int i=1;i<=p;i++)    

  ^
literegen1.cpp:35:2: error: stray '\240' in program
literegen1.cpp:35:2: error: stray '\302' in program
literegen1.cpp:35:2: error: stray '\240' in program
literegen1.cpp:37:2: error: stray '\302' in program
  a[nr][p+2]='1',a[nr][p+3]='0';  

  ^
literegen1.cpp:37:2: error: stray '\240' in program
literegen1.cpp:38:2: error: stray '\302' in program
  a[nr][p+4]='\0';  

  ^
literegen1.cpp:38:2: error: stray '\240' in program
literegen1.cpp:42:1: error: stray '\302' in program
 {    int k;    

 ^
literegen1.cpp:42:1: error: stray '\240' in program
literegen1.cpp:42:1: error: stray '\302' in program
literegen1.cpp:42:1: error: stray '\240' in program
literegen1.cpp:42:1: error: stray '\302' in program
literegen1.cpp:42:1: error: stray '\240' in program
literegen1.cpp:42:1: error: stray '\302' in program
literegen1.cpp:42:1: error: stray '\240' in program
literegen1.cpp:43:2: error: stray '\302' in program
  k=1;    

  ^
literegen1.cpp:43:2: error: stray '\240' in program
literegen1.cpp:43:2: error: stray '\302' in program
literegen1.cpp:43:2: error: stray '\240' in program
literegen1.cpp:44:2: error: stray '\302' in program
  init(k);   

  ^
literegen1.cpp:44:2: error: stray '\240' in program
literegen1.cpp:44:2: error: stray '\302' in program
literegen1.cpp:44:2: error: stray '\240' in program
literegen1.cpp:45:2: error: stray '\302' in program
  while(k>0) 

  ^
literegen1.cpp:45:2: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
      if(solutie(k))        {            retin();            k--;        }        else            if(succesor(k))            {                x[k]++;                if(continuare(k))                    k++;            }            else                init(k),k--;}

      ^
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:46:6: error: stray '\302' in program
literegen1.cpp:46:6: error: stray '\240' in program
literegen1.cpp:48:1: error: stray '\302' in program
 {    cin>>p;

 ^
literegen1.cpp:48:1: error: stray '\240' in program
literegen1.cpp:48:1: error: stray '\302' in program
literegen1.cpp:48:1: error: stray '\240' in program
literegen1.cpp:49:2: error: stray '\302' in program
  if(p%2==0)  

  ^
literegen1.cpp:49:2: error: stray '\240' in program
literegen1.cpp:50:6: error: stray '\302' in program
      return 0;  

      ^
literegen1.cpp:50:6: error: stray '\240' in program
literegen1.cpp:51:2: error: stray '\302' in program
  if(p==3)       

  ^
literegen1.cpp:51:2: error: stray '\240' in program
literegen1.cpp:51:2: error: stray '\302' in program
literegen1.cpp:51:2: error: stray '\240' in program
literegen1.cpp:51:2: error: stray '\302' in program
literegen1.cpp:51:2: error: stray '\240' in program
literegen1.cpp:51:2: error: stray '\302' in program
literegen1.cpp:51:2: error: stray '\240' in program
literegen1.cpp:52:6: error: stray '\302' in program
      cout<<"010\n"; 

      ^
literegen1.cpp:52:6: error: stray '\240' in program
literegen1.cpp:53:2: error: stray '\302' in program
  else   

  ^
literegen1.cpp:53:2: error: stray '\240' in program
literegen1.cpp:53:2: error: stray '\302' in program
literegen1.cpp:53:2: error: stray '\240' in program
literegen1.cpp:54:2: error: stray '\302' in program
  {      

  ^
literegen1.cpp:54:2: error: stray '\240' in program
literegen1.cpp:54:2: error: stray '\302' in program
literegen1.cpp:54:2: error: stray '\240' in program
literegen1.cpp:54:2: error: stray '\302' in program
literegen1.cpp:54:2: error: stray '\240' in program
literegen1.cpp:56:6: error: stray '\302' in program
      char aux[20];     

      ^
literegen1.cpp:56:6: error: stray '\240' in program
literegen1.cpp:56:6: error: stray '\302' in program
literegen1.cpp:56:6: error: stray '\240' in program
literegen1.cpp:56:6: error: stray '\302' in program
literegen1.cpp:56:6: error: stray '\240' in program
literegen1.cpp:57:6: error: stray '\302' in program
      for(int i=0;i<nr-1;i++)   

      ^
literegen1.cpp:57:6: error: stray '\240' in program
literegen1.cpp:57:6: error: stray '\302' in program
literegen1.cpp:57:6: error: stray '\240' in program
literegen1.cpp:58:10: error: stray '\302' in program
          for(int j=i+1;j<=nr-1;++j)   

          ^
literegen1.cpp:58:10: error: stray '\240' in program
literegen1.cpp:58:10: error: stray '\302' in program
literegen1.cpp:58:10: error: stray '\240' in program
literegen1.cpp:59:10: error: stray '\302' in program
          if(strcmp(a[i],a[j])==1)    

          ^
literegen1.cpp:59:10: error: stray '\240' in program
literegen1.cpp:59:10: error: stray '\302' in program
literegen1.cpp:59:10: error: stray '\240' in program
literegen1.cpp:60:10: error: stray '\302' in program
          strcpy(aux,a[i]),strcpy(a[i],a[j]),strcpy(a[j],aux);    

          ^
literegen1.cpp:60:10: error: stray '\240' in program
literegen1.cpp:60:10: error: stray '\302' in program
literegen1.cpp:60:10: error: stray '\240' in program
literegen1.cpp:61:6: error: stray '\302' in program
      for(int i=0;i<nr;++i)    

      ^
literegen1.cpp:61:6: error: stray '\240' in program
literegen1.cpp:61:6: error: stray '\302' in program
literegen1.cpp:61:6: error: stray '\240' in program
literegen1.cpp:62:10: error: stray '\302' in program
          cout<<a[i]<<'\n';    

          ^
literegen1.cpp:62:10: error: stray '\240' in program
literegen1.cpp:62:10: error: stray '\302' in program
literegen1.cpp:62:10: error: stray '\240' in program
literegen1.cpp:63:2: error: stray '\302' in program
  }    

  ^
literegen1.cpp:63:2: error: stray '\240' in program
literegen1.cpp:63:2: error: stray '\302' in program
literegen1.cpp:63:2: error: stray '\240' in program
literegen1.cpp:5:7: error: 'NR' was not declared in this scope
 int x[NR],p,k,nr;

       ^
literegen1.cpp: In function 'void init(int)':
literegen1.cpp:9:5: error: 'x' was not declared in this scope
     x[k]=0;

     ^
literegen1.cpp: In function 'int succesor(int)':
literegen1.cpp:13:8: error: 'x' was not declared in this scope
     if(x[k]<10)

        ^
literegen1.cpp: In function 'int continuare(int)':
literegen1.cpp:19:21: error: 'x' was not declared in this scope
 {    if(k==1&&abs(x[k]-2)!=1)  

                     ^
literegen1.cpp:21:15: error: 'x' was not declared in this scope
  if(k==p&&abs(x[k]-2)!=1) 

               ^
literegen1.cpp:24:13: error: 'x' was not declared in this scope
      if(abs(x[i]-x[i-1])!=1)   

             ^
literegen1.cpp: In function 'void retin()':
literegen1.cpp:36:21: error: 'x' was not declared in this scope
      a[nr][i+1]='0'+x[i]-1;

                     ^
literegen1.cpp: In function 'void backtracking()':
literegen1.cpp:46:186: error: 'x' was not declared in this scope
      if(solutie(k))        {            retin();            k--;        }        else            if(succesor(k))            {                x[k]++;                if(continuare(k))                    k++;            }            else                init(k),k--;}

                                                                                                                                                                                          ^
literegen1.cpp: In function 'int succesor(int)':
literegen1.cpp:17:1: warning: control reaches end of non-void function [-Wreturn-type]
 }

 ^

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