#3178
Copii2
Într-o clasă sunt F
fete și B
băieți. Fiecare fată citește 3
pagini pe zi și fiecare băiat citește 2
pagini pe zi. Câte pagini vor citi copiii în n
zile?
Problema | Copii2 | Operații I/O |
![]() |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #56763942 | Utilizator | |
Fișier | copii2.cpp | Dimensiune | 1.68 KB |
Data încărcării | 05 Martie 2025, 09:33 | Scor / rezultat | Eroare de compilare |
copii2.cpp:24:2: error: stray '#' in program }#include <iostream> ^ copii2.cpp:48:2: error: stray '#' in program }#include <iostream> ^ copii2.cpp:75:2: error: stray '#' in program }#include <iostream> ^ copii2.cpp:24:3: error: 'include' does not name a type }#include <iostream> ^ copii2.cpp:27:5: error: redefinition of 'int a' int a; ^ copii2.cpp:4:11: error: 'int a' previously declared here int n, k, a; ^ copii2.cpp:28:19: error: conflicting declaration 'char v [101]' char s[101], v[101]; ^ copii2.cpp:5:13: error: 'v' has a previous declaration as 'char v [21][11]' char x[11], v[21][11]; ^ copii2.cpp: In function 'int main()': copii2.cpp:29:5: error: redefinition of 'int main()' int main() ^ copii2.cpp:6:5: error: 'int main()' previously defined here int main() ^ copii2.cpp:36:10: error: incompatible types in assignment of 'char' to 'char [11]' v[0]='\0'; ^ copii2.cpp:37:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (int i=0; i<strlen(p); i++) ^ copii2.cpp:38:47: error: no matching function for call to 'strchr(char [21][11], char&)' if (strchr("aeiou", p[i]) && strchr(v, p[i])==NULL) ^ copii2.cpp:38:47: note: candidates are: In file included from /usr/include/c++/4.8/cstring:42:0, from copii2.cpp:2: /usr/include/string.h:223:1: note: char* strchr(char*, int) strchr (char *__s, int __c) __THROW ^ /usr/include/string.h:223:1: note: no known conversion for argument 1 from 'char [21][11]' to 'char*' /usr/include/string.h:229:1: note: const char* strchr(const char*, int) strchr (const char *__s, int __c) __THROW ^ /usr/include/string.h:229:1: note: no known conversion for argument 1 from 'char [21][11]' to 'const char*' copii2.cpp:40:9: error: incompatible types in assignment of 'char' to 'char [11]' v[a]=p[i]; ^ copii2.cpp:43:7: error: incompatible types in assignment of 'char' to 'char [11]' v[a]='\0'; ^ copii2.cpp:44:15: error: cannot convert 'char (*)[11]' to 'const char*' for argument '1' to 'size_t strlen(const char*)' if (strlen(v)==1) cout<<p<<'\n'; ^ copii2.cpp: At global scope: copii2.cpp:48:3: error: 'include' does not name a type }#include <iostream> ^ copii2.cpp:51:5: error: redefinition of 'int n' int n, a, b; ^ copii2.cpp:4:5: error: 'int n' previously declared here int n, k, a; ^ copii2.cpp:51:8: error: redefinition of 'int a' int n, a, b; ^ copii2.cpp:4:11: error: 'int a' previously declared here int n, k, a; ^ copii2.cpp:52:11: error: redefinition of 'char s [101]' char s[101], v[101][101], t[101][101]; ^ copii2.cpp:28:6: error: 'char s [101]' previously declared here char s[101], v[101]; ^ copii2.cpp:52:24: error: conflicting declaration 'char v [101][101]' char s[101], v[101][101], t[101][101]; ^ copii2.cpp:5:13: error: 'v' has a previous declaration as 'char v [21][11]' char x[11], v[21][11]; ^ copii2.cpp: In function 'int main()': copii2.cpp:53:5: error: redefinition of 'int main()' int main() ^ copii2.cpp:6:5: error: 'int main()' previously defined here int main() ^ copii2.cpp:61:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if (strlen(p)>=n) {a++; ^ copii2.cpp: At global scope: copii2.cpp:75:3: error: 'include' does not name a type }#include <iostream> ^ copii2.cpp:78:11: error: redefinition of 'char s [101]' char s[101], rez[101]; ^ copii2.cpp:28:6: error: 'char s [101]' previously declared here char s[101], v[101]; ^ copii2.cpp: In function 'int main()': copii2.cpp:79:5: error: redefinition of 'int main()' int main() ^ copii2.cpp:6:5: error: 'int main()' previously defined here int main() ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Copii2 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ă.