#2778
next_perm
C++
Scrieți definiția completă a subprogramului C++:
void next_perm(int n, int P[])
Subprogramul are 2 parametri:
n
– prin care primește un număr naturalP
– prin care primește un tablou unidimensional cu n
elemente ce reprezintă o permutare a mulțimii {1,2,...,n}
.Subprogramul va returna tot în parametru P
următoarea permutare din punct de vedere lexicografic.
Problema | next_perm | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #15928814 | Utilizator | |
Fișier | next_perm.cpp | Dimensiune | 397 B |
Data încărcării | 21 Mai 2019, 22:26 | Scor / rezultat | Eroare de compilare |
next_perm.cpp:11:1: error: stray '\302' in program int permutare(int a[1001], int n) ^ next_perm.cpp:11:1: error: stray '\240' in program next_perm.cpp:11:1: error: stray '\302' in program next_perm.cpp:11:1: error: stray '\240' in program next_perm.cpp:11:1: error: stray '\302' in program next_perm.cpp:11:1: error: stray '\240' in program next_perm.cpp:11:1: error: stray '\302' in program next_perm.cpp:11:1: error: stray '\240' in program next_perm.cpp:13:1: error: stray '\302' in program int i, v[1001]={0}; ^ next_perm.cpp:13:1: error: stray '\240' in program next_perm.cpp:13:1: error: stray '\302' in program next_perm.cpp:13:1: error: stray '\240' in program next_perm.cpp:13:1: error: stray '\302' in program next_perm.cpp:13:1: error: stray '\240' in program next_perm.cpp:13:1: error: stray '\302' in program next_perm.cpp:13:1: error: stray '\240' in program next_perm.cpp:13:1: error: stray '\302' in program next_perm.cpp:13:1: error: stray '\240' in program next_perm.cpp:13:1: error: stray '\302' in program next_perm.cpp:13:1: error: stray '\240' in program next_perm.cpp:14:1: error: stray '\302' in program for(i = 0; i < n; i++) ^ next_perm.cpp:14:1: error: stray '\240' in program next_perm.cpp:14:1: error: stray '\302' in program next_perm.cpp:14:1: error: stray '\240' in program next_perm.cpp:14:1: error: stray '\302' in program next_perm.cpp:14:1: error: stray '\240' in program next_perm.cpp:14:1: error: stray '\302' in program next_perm.cpp:14:1: error: stray '\240' in program next_perm.cpp:14:1: error: stray '\302' in program next_perm.cpp:14:1: error: stray '\240' in program next_perm.cpp:14:1: error: stray '\302' in program next_perm.cpp:14:1: error: stray '\240' in program next_perm.cpp:14:1: error: stray '\302' in program next_perm.cpp:14:1: error: stray '\240' in program next_perm.cpp:14:1: error: stray '\302' in program next_perm.cpp:14:1: error: stray '\240' in program next_perm.cpp:14:1: error: stray '\302' in program next_perm.cpp:14:1: error: stray '\240' in program next_perm.cpp:14:1: error: stray '\302' in program next_perm.cpp:14:1: error: stray '\240' in program next_perm.cpp:15:1: error: stray '\302' in program v[a[i]] ++; ^ next_perm.cpp:15:1: error: stray '\240' in program next_perm.cpp:15:1: error: stray '\302' in program next_perm.cpp:15:1: error: stray '\240' in program next_perm.cpp:15:1: error: stray '\302' in program next_perm.cpp:15:1: error: stray '\240' in program next_perm.cpp:15:1: error: stray '\302' in program next_perm.cpp:15:1: error: stray '\240' in program next_perm.cpp:15:1: error: stray '\302' in program next_perm.cpp:15:1: error: stray '\240' in program next_perm.cpp:15:1: error: stray '\302' in program next_perm.cpp:15:1: error: stray '\240' in program next_perm.cpp:15:1: error: stray '\302' in program next_perm.cpp:15:1: error: stray '\240' in program next_perm.cpp:15:1: error: stray '\302' in program next_perm.cpp:15:1: error: stray '\240' in program next_perm.cpp:15:1: error: stray '\302' in program next_perm.cpp:15:1: error: stray '\240' in program next_perm.cpp:16:1: error: stray '\302' in program for(i = 0; i < n; i ++) ^ next_perm.cpp:16:1: error: stray '\240' in program next_perm.cpp:16:1: error: stray '\302' in program next_perm.cpp:16:1: error: stray '\240' in program next_perm.cpp:16:1: error: stray '\302' in program next_perm.cpp:16:1: error: stray '\240' in program next_perm.cpp:16:1: error: stray '\302' in program next_perm.cpp:16:1: error: stray '\240' in program next_perm.cpp:16:1: error: stray '\302' in program next_perm.cpp:16:1: error: stray '\240' in program next_perm.cpp:16:1: error: stray '\302' in program next_perm.cpp:16:1: error: stray '\240' in program next_perm.cpp:16:1: error: stray '\302' in program next_perm.cpp:16:1: error: stray '\240' in program next_perm.cpp:16:1: error: stray '\302' in program next_perm.cpp:16:1: error: stray '\240' in program next_perm.cpp:16:1: error: stray '\302' in program next_perm.cpp:16:1: error: stray '\240' in program next_perm.cpp:16:1: error: stray '\302' in program next_perm.cpp:16:1: error: stray '\240' in program next_perm.cpp:16:1: error: stray '\302' in program next_perm.cpp:16:1: error: stray '\240' in program next_perm.cpp:17:1: error: stray '\302' in program { ^ next_perm.cpp:17:1: error: stray '\240' in program next_perm.cpp:17:1: error: stray '\302' in program next_perm.cpp:17:1: error: stray '\240' in program next_perm.cpp:17:1: error: stray '\302' in program next_perm.cpp:17:1: error: stray '\240' in program next_perm.cpp:17:1: error: stray '\302' in program next_perm.cpp:17:1: error: stray '\240' in program next_perm.cpp:17:1: error: stray '\302' in program next_perm.cpp:17:1: error: stray '\240' in program next_perm.cpp:17:1: error: stray '\302' in program next_perm.cpp:17:1: error: stray '\240' in program next_perm.cpp:17:1: error: stray '\302' in program next_perm.cpp:17:1: error: stray '\240' in program next_perm.cpp:18:1: error: stray '\302' in program if(a[i] == i+1) return 0; ^ next_perm.cpp:18:1: error: stray '\240' in program next_perm.cpp:18:1: error: stray '\302' in program next_perm.cpp:18:1: error: stray '\240' in program next_perm.cpp:18:1: error: stray '\302' in program next_perm.cpp:18:1: error: stray '\240' in program next_perm.cpp:18:1: error: stray '\302' in program next_perm.cpp:18:1: error: stray '\240' in program next_perm.cpp:18:1: error: stray '\302' in program next_perm.cpp:18:1: error: stray '\240' in program next_perm.cpp:18:1: error: stray '\302' in program next_perm.cpp:18:1: error: stray '\240' in program next_perm.cpp:18:1: error: stray '\302' in program next_perm.cpp:18:1: error: stray '\240' in program next_perm.cpp:18:1: error: stray '\302' in program next_perm.cpp:18:1: error: stray '\240' in program next_perm.cpp:18:1: error: stray '\302' in program next_perm.cpp:18:1: error: stray '\240' in program next_perm.cpp:18:1: error: stray '\302' in program next_perm.cpp:18:1: error: stray '\240' in program next_perm.cpp:18:1: error: stray '\302' in program next_perm.cpp:18:1: error: stray '\240' in program next_perm.cpp:18:1: error: stray '\302' in program next_perm.cpp:18:1: error: stray '\240' in program next_perm.cpp:18:1: error: stray '\302' in program next_perm.cpp:18:1: error: stray '\240' in program next_perm.cpp:18:1: error: stray '\302' in program next_perm.cpp:18:1: error: stray '\240' in program next_perm.cpp:18:1: error: stray '\302' in program next_perm.cpp:18:1: error: stray '\240' in program next_perm.cpp:19:1: error: stray '\302' in program if(v[i+1] != 1) return 0; ^ next_perm.cpp:19:1: error: stray '\240' in program next_perm.cpp:19:1: error: stray '\302' in program next_perm.cpp:19:1: error: stray '\240' in program next_perm.cpp:19:1: error: stray '\302' in program next_perm.cpp:19:1: error: stray '\240' in program next_perm.cpp:19:1: error: stray '\302' in program next_perm.cpp:19:1: error: stray '\240' in program next_perm.cpp:19:1: error: stray '\302' in program next_perm.cpp:19:1: error: stray '\240' in program next_perm.cpp:19:1: error: stray '\302' in program next_perm.cpp:19:1: error: stray '\240' in program next_perm.cpp:19:1: error: stray '\302' in program next_perm.cpp:19:1: error: stray '\240' in program next_perm.cpp:19:1: error: stray '\302' in program next_perm.cpp:19:1: error: stray '\240' in program next_perm.cpp:19:1: error: stray '\302' in program next_perm.cpp:19:1: error: stray '\240' in program next_perm.cpp:19:1: error: stray '\302' in program next_perm.cpp:19:1: error: stray '\240' in program next_perm.cpp:19:1: error: stray '\302' in program next_perm.cpp:19:1: error: stray '\240' in program next_perm.cpp:19:1: error: stray '\302' in program next_perm.cpp:19:1: error: stray '\240' in program next_perm.cpp:19:1: error: stray '\302' in program next_perm.cpp:19:1: error: stray '\240' in program next_perm.cpp:19:1: error: stray '\302' in program next_perm.cpp:19:1: error: stray '\240' in program next_perm.cpp:19:1: error: stray '\302' in program next_perm.cpp:19:1: error: stray '\240' in program next_perm.cpp:20:1: error: stray '\302' in program } ^ next_perm.cpp:20:1: error: stray '\240' in program next_perm.cpp:20:1: error: stray '\302' in program next_perm.cpp:20:1: error: stray '\240' in program next_perm.cpp:20:1: error: stray '\302' in program next_perm.cpp:20:1: error: stray '\240' in program next_perm.cpp:20:1: error: stray '\302' in program next_perm.cpp:20:1: error: stray '\240' in program next_perm.cpp:20:1: error: stray '\302' in program next_perm.cpp:20:1: error: stray '\240' in program next_perm.cpp:20:1: error: stray '\302' in program next_perm.cpp:20:1: error: stray '\240' in program next_perm.cpp:20:1: error: stray '\302' in program next_perm.cpp:20:1: error: stray '\240' in program next_perm.cpp:21:1: error: stray '\302' in program return 1; ^ next_perm.cpp:21:1: error: stray '\240' in program next_perm.cpp:21:1: error: stray '\302' in program next_perm.cpp:21:1: error: stray '\240' in program next_perm.cpp:21:1: error: stray '\302' in program next_perm.cpp:21:1: error: stray '\240' in program next_perm.cpp:21:1: error: stray '\302' in program next_perm.cpp:21:1: error: stray '\240' in program next_perm.cpp:21:1: error: stray '\302' in program next_perm.cpp:21:1: error: stray '\240' in program next_perm.cpp:21:1: error: stray '\302' in program next_perm.cpp:21:1: error: stray '\240' in program next_perm.cpp:21:1: error: stray '\302' in program next_perm.cpp:21:1: error: stray '\240' in program next_perm.cpp:21:1: error: stray '\302' in program next_perm.cpp:21:1: error: stray '\240' in program next_perm.cpp: In function 'int main()': next_perm.cpp:32:19: error: 'next_perm' was not declared in this scope next_perm(n, P); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema next_perm face parte din a doua categorie. Pentru aceste probleme se folosește un program suport, furnizat de propunătorul problemei. 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ă.