#1812
LitereGen1
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.
Problema | LitereGen1 | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.4 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #27998886 | Utilizator | |
Fișier | literegen1.cpp | Dimensiune | 703 B |
Data încărcării | 18 Februarie 2021, 11:30 | Scor / rezultat | Eroare de compilare |
literegen1.cpp:5:1: error: stray '\302' in program ^ literegen1.cpp:5: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:11:1: error: stray '\302' in program for(int i=1; i<=n; i++) ^ literegen1.cpp:11:1: error: stray '\240' in program literegen1.cpp:11:1: error: stray '\302' in program literegen1.cpp:11:1: error: stray '\240' in program literegen1.cpp:12:1: error: stray '\302' in program cout<<v[i]; ^ 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: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:13:1: error: stray '\302' in program cout<<'\n'; ^ literegen1.cpp:13:1: error: stray '\240' in program literegen1.cpp:13:1: error: stray '\302' in program literegen1.cpp:13:1: error: stray '\240' in program literegen1.cpp:15:1: error: stray '\302' in program ^ literegen1.cpp:15:1: error: stray '\240' in program literegen1.cpp:18:1: error: stray '\302' in program if(abs(v[k]-v[k-1])!=1)return 0; ^ literegen1.cpp:18:1: error: stray '\240' in program literegen1.cpp:18:1: error: stray '\302' in program literegen1.cpp:18:1: error: stray '\240' in program literegen1.cpp:19:1: error: stray '\302' in program if(k==n-2 && abs(v[n-2]-v[n-1])!=1)return 0; ^ 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:1: error: stray '\302' in program return 1; ^ literegen1.cpp:20:1: error: stray '\240' in program literegen1.cpp:20:1: error: stray '\302' in program literegen1.cpp:20:1: error: stray '\240' in program literegen1.cpp:22:1: error: stray '\302' in program ^ literegen1.cpp:22:1: error: stray '\240' in program literegen1.cpp:25:1: error: stray '\302' in program if(k==n-1)afis(); ^ literegen1.cpp:25:1: error: stray '\240' in program literegen1.cpp:25:1: error: stray '\302' in program literegen1.cpp:25:1: error: stray '\240' in program literegen1.cpp:26:1: error: stray '\302' in program else{ ^ literegen1.cpp:26:1: error: stray '\240' in program literegen1.cpp:26:1: error: stray '\302' in program literegen1.cpp:26:1: error: stray '\240' in program literegen1.cpp:27:1: error: stray '\302' in program for(char i='a'; i<='z'; i++ ) ^ 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: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:1: error: stray '\302' in program { ^ literegen1.cpp:28:1: error: stray '\240' in program literegen1.cpp:28:1: error: stray '\302' in program literegen1.cpp:28:1: error: stray '\240' in program literegen1.cpp:28:1: error: stray '\302' in program literegen1.cpp:28:1: error: stray '\240' in program literegen1.cpp:28:1: error: stray '\302' in program literegen1.cpp:28:1: error: stray '\240' in program literegen1.cpp:29:1: error: stray '\302' in program v[k]=i; ^ literegen1.cpp:29:1: error: stray '\240' in program literegen1.cpp:29:1: error: stray '\302' in program literegen1.cpp:29:1: error: stray '\240' in program literegen1.cpp:29:1: error: stray '\302' in program literegen1.cpp:29:1: error: stray '\240' in program literegen1.cpp:29:1: error: stray '\302' in program literegen1.cpp:29:1: error: stray '\240' in program literegen1.cpp:29:1: error: stray '\302' in program literegen1.cpp:29:1: error: stray '\240' in program literegen1.cpp:29:1: error: stray '\302' in program literegen1.cpp:29:1: error: stray '\240' in program literegen1.cpp:30:1: error: stray '\302' in program if(valid(k)==1)backtr(k+1); ^ literegen1.cpp:30:1: error: stray '\240' in program literegen1.cpp:30:1: error: stray '\302' in program literegen1.cpp:30:1: error: stray '\240' in program literegen1.cpp:30:1: error: stray '\302' in program literegen1.cpp:30:1: error: stray '\240' in program literegen1.cpp:30:1: error: stray '\302' in program literegen1.cpp:30:1: error: stray '\240' in program literegen1.cpp:30:1: error: stray '\302' in program literegen1.cpp:30:1: error: stray '\240' in program literegen1.cpp:30:1: error: stray '\302' in program literegen1.cpp:30:1: error: stray '\240' in program literegen1.cpp:31:1: error: stray '\302' in program } ^ literegen1.cpp:31:1: error: stray '\240' in program literegen1.cpp:31:1: error: stray '\302' in program literegen1.cpp:31:1: error: stray '\240' in program literegen1.cpp:31:1: error: stray '\302' in program literegen1.cpp:31:1: error: stray '\240' in program literegen1.cpp:31:1: error: stray '\302' in program literegen1.cpp:31:1: error: stray '\240' in program literegen1.cpp:32:1: error: stray '\302' in program ^ literegen1.cpp:32:1: error: stray '\240' in program literegen1.cpp:33:1: error: stray '\302' in program } ^ literegen1.cpp:33:1: error: stray '\240' in program literegen1.cpp:33:1: error: stray '\302' in program literegen1.cpp:33:1: error: stray '\240' in program literegen1.cpp:37:1: error: stray '\302' in program cin>>n; ^ literegen1.cpp:37:1: error: stray '\240' in program literegen1.cpp:37:1: error: stray '\302' in program literegen1.cpp:37:1: error: stray '\240' in program literegen1.cpp:38:1: error: stray '\302' in program v[1]='a'; ^ literegen1.cpp:38:1: error: stray '\240' in program literegen1.cpp:38:1: error: stray '\302' in program literegen1.cpp:38:1: error: stray '\240' in program literegen1.cpp:39:1: error: stray '\302' in program v[2]='b'; ^ literegen1.cpp:39:1: error: stray '\240' in program literegen1.cpp:39:1: error: stray '\302' in program literegen1.cpp:39:1: error: stray '\240' in program literegen1.cpp:40:1: error: stray '\302' in program v[n-1]='b'; ^ literegen1.cpp:40:1: error: stray '\240' in program literegen1.cpp:40:1: error: stray '\302' in program literegen1.cpp:40:1: error: stray '\240' in program literegen1.cpp:41:1: error: stray '\302' in program v[n]='a'; ^ literegen1.cpp:41:1: error: stray '\240' in program literegen1.cpp:41:1: error: stray '\302' in program literegen1.cpp:41:1: error: stray '\240' in program literegen1.cpp:42:1: error: stray '\302' in program backtr(3); ^ 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:1: error: stray '\302' in program return 0; ^ literegen1.cpp:43:1: error: stray '\240' in program literegen1.cpp:43:1: error: stray '\302' in program literegen1.cpp:43:1: error: stray '\240' in program literegen1.cpp: In function 'int afis()': literegen1.cpp:14:1: warning: no return statement in function returning non-void [-Wreturn-type] } ^ literegen1.cpp: In function 'int backtr(int)': literegen1.cpp:34:1: warning: no return statement in function returning non-void [-Wreturn-type] } ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema LitereGen1 face parte din prima categorie. Soluția propusă de tine va fi evaluată astfel:
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ă.