#4086
cmmdc5
Se dă un șir a
1
, a
2
, …, a
n
de numere naturale nenule. Să se determine răspunsul pentru una din următoarele cerințe:
n
numere.n-1
elemente din șir.n-2
elemente din șir.OJI 2022, Clasa a VI-a
Problema | cmmdc5 | Operații I/O |
cmmdc.in /cmmdc.out
|
---|---|---|---|
Limita timp | 0.5 secunde | Limita memorie |
Total: 128 MB
/
Stivă 64 MB
|
Id soluție | #53153815 | Utilizator | |
Fișier | cmmdc5.cpp | Dimensiune | 432 B |
Data încărcării | 19 Octombrie 2024, 12:02 | Scor / rezultat | Eroare de compilare |
cmmdc5.cpp:4:5: warning: character constant too long for its type [enabled by default] fin('cmmdc.in'); ^ cmmdc5.cpp:5:6: warning: character constant too long for its type [enabled by default] fout('cmmdc.out'); ^ cmmdc5.cpp:4:4: error: expected constructor, destructor, or type conversion before '(' token fin('cmmdc.in'); ^ cmmdc5.cpp:5:5: error: expected constructor, destructor, or type conversion before '(' token fout('cmmdc.out'); ^ cmmdc5.cpp:6:24: error: 'long long int div' redeclared as different kind of symbol long long v[101],n,i,d,div; ^ In file included from /usr/include/c++/4.8/cstdlib:72:0, from /usr/include/c++/4.8/ext/string_conversions.h:41, from /usr/include/c++/4.8/bits/basic_string.h:2815, from /usr/include/c++/4.8/string:52, from /usr/include/c++/4.8/bits/locale_classes.h:40, from /usr/include/c++/4.8/bits/ios_base.h:41, from /usr/include/c++/4.8/ios:42, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from cmmdc5.cpp:1: /usr/include/stdlib.h:789:14: error: previous declaration of 'div_t div(int, int)' extern div_t div (int __numer, int __denom) ^ cmmdc5.cpp: In function 'int main()': cmmdc5.cpp:9:5: error: 'fin' was not declared in this scope fin>>n; ^ cmmdc5.cpp:19:20: error: overloaded function with no contextual type information div=d; ^ cmmdc5.cpp:20:18: error: invalid operands of types 'long long int' and '<unresolved overloaded function type>' to binary 'operator>' if(d>div) ^ cmmdc5.cpp:21:20: error: overloaded function with no contextual type information div=d; ^ cmmdc5.cpp:24:5: error: 'fout' was not declared in this scope fout<<div; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema cmmdc5 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ă.