#1996
zigzag
Scrieţi un program care citeşte cheia de codificare şi un text codificat şi determină mesajul decodificat.
Problema | zigzag | Operații I/O |
zigzag.in /zigzag.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 2 MB
/
Stivă 1 MB
|
Id soluție | #53478297 | Utilizator | |
Fișier | zigzag.cpp | Dimensiune | 1.04 KB |
Data încărcării | 01 Noiembrie 2024, 21:54 | Scor / rezultat | Eroare de compilare |
zigzag.cpp: In function 'int main()': zigzag.cpp:10:8: error: no match for 'operator=' (operand types are 'FILE {aka _IO_FILE}' and 'FILE* {aka _IO_FILE*}') fin=fopen("zigzag.in","r"); ^ zigzag.cpp:10:8: note: candidates are: In file included from /usr/include/stdio.h:74:0, from /usr/include/c++/4.8/cstdio:42, from /usr/include/c++/4.8/ext/string_conversions.h:43, 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/istream:38, from /usr/include/c++/4.8/fstream:38, from zigzag.cpp:1: /usr/include/libio.h:245:8: note: _IO_FILE& _IO_FILE::operator=(const _IO_FILE&) struct _IO_FILE { ^ /usr/include/libio.h:245:8: note: no known conversion for argument 1 from 'FILE* {aka _IO_FILE*}' to 'const _IO_FILE&' /usr/include/libio.h:245:8: note: _IO_FILE& _IO_FILE::operator=(_IO_FILE&&) /usr/include/libio.h:245:8: note: no known conversion for argument 1 from 'FILE* {aka _IO_FILE*}' to '_IO_FILE&&' zigzag.cpp:11:28: error: cannot convert 'FILE {aka _IO_FILE}' to 'FILE* {aka _IO_FILE*}' for argument '1' to 'int fscanf(FILE*, const char*, ...)' fscanf(fin,"%d%d",&c,&n); ^ zigzag.cpp:12:25: error: cannot convert 'FILE {aka _IO_FILE}' to 'FILE* {aka _IO_FILE*}' for argument '1' to 'int fscanf(FILE*, const char*, ...)' fscanf(fin,"%c",&chr); ^ zigzag.cpp:14:30: error: cannot convert 'FILE {aka _IO_FILE}' to 'FILE* {aka _IO_FILE*}' for argument '1' to 'int fscanf(FILE*, const char*, ...)' {fscanf(fin,"%c",&chr);a[i]=chr;} ^ zigzag.cpp:15:12: error: unable to find numeric literal operator 'operator"" c' nr=(n%(2c-2)==0?n/(2c-2):n/(2c-2)+1); ^ zigzag.cpp:15:24: error: unable to find numeric literal operator 'operator"" c' nr=(n%(2c-2)==0?n/(2c-2):n/(2c-2)+1); ^ zigzag.cpp:15:33: error: unable to find numeric literal operator 'operator"" c' nr=(n%(2c-2)==0?n/(2c-2):n/(2c-2)+1); ^ zigzag.cpp:16:10: error: unable to find numeric literal operator 'operator"" c' m=nr(2c-2); ^ zigzag.cpp:16:14: error: 'nr' cannot be used as a function m=nr(2c-2); ^ zigzag.cpp:23:16: error: unable to find numeric literal operator 'operator"" c' if(s[x(2c-2)+1]!='X') ^ zigzag.cpp:23:20: error: 'x' cannot be used as a function if(s[x(2c-2)+1]!='X') ^ zigzag.cpp:24:22: error: unable to find numeric literal operator 'operator"" c' {s[x(2c-2)+1]=a[k++];} ^ zigzag.cpp:24:26: error: 'x' cannot be used as a function {s[x(2c-2)+1]=a[k++];} ^ zigzag.cpp:31:20: error: unable to find numeric literal operator 'operator"" c' if(s[x(2c-2)+p]!='X') ^ zigzag.cpp:31:24: error: 'x' cannot be used as a function if(s[x(2c-2)+p]!='X') ^ zigzag.cpp:32:21: error: unable to find numeric literal operator 'operator"" c' s[x(2c-2)+p]=a[k++]; ^ zigzag.cpp:32:25: error: 'x' cannot be used as a function s[x(2c-2)+p]=a[k++]; ^ zigzag.cpp:33:20: error: unable to find numeric literal operator 'operator"" c' if(s[x(2c-2)+2c-p]!='X') ^ zigzag.cpp:33:24: error: 'x' cannot be used as a function if(s[x(2c-2)+2c-p]!='X') ^ zigzag.cpp:33:26: error: unable to find numeric literal operator 'operator"" c' if(s[x(2c-2)+2c-p]!='X') ^ zigzag.cpp:34:21: error: unable to find numeric literal operator 'operator"" c' s[x(2c-2)+2c-p]=a[k++]; ^ zigzag.cpp:34:25: error: 'x' cannot be used as a function s[x(2c-2)+2c-p]=a[k++]; ^ zigzag.cpp:34:27: error: unable to find numeric literal operator 'operator"" c' s[x(2c-2)+2c-p]=a[k++]; ^ zigzag.cpp:40:16: error: unable to find numeric literal operator 'operator"" c' if(s[x(2c-2)+c]!='X') ^ zigzag.cpp:40:20: error: 'x' cannot be used as a function if(s[x(2c-2)+c]!='X') ^ zigzag.cpp:41:21: error: unable to find numeric literal operator 'operator"" c' s[x(2c-2)+c]=a[k++]; ^ zigzag.cpp:41:25: error: 'x' cannot be used as a function s[x(2c-2)+c]=a[k++]; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema zigzag 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ă.