#3479
2lan
C++
Se da un număr n
. Calculați ultima cifră a lui \({2}^{n}\).
Problema | 2lan | Operații I/O |
2lan.in /2lan.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 0.1 MB
/
Stivă 0.1 MB
|
Id soluție | #51319371 | Utilizator | |
Fișier | lan.cpp | Dimensiune | 375 B |
Data încărcării | 06 Iunie 2024, 19:08 | Scor / rezultat | Eroare de compilare |
lan.cpp: In function 'int main()': lan.cpp:11:31: error: invalid conversion from 'int' to 'const char*' [-fpermissive] if (n%4==1) fprintf(g,2); ^ In file included from /usr/include/stdio.h:937:0, from lan.cpp:1: /usr/include/i386-linux-gnu/bits/stdio2.h:95:1: error: initializing argument 2 of 'int fprintf(FILE*, const char*, ...)' [-fpermissive] fprintf (FILE *__restrict __stream, const char *__restrict __fmt, ...) ^ lan.cpp:11:31: warning: format not a string literal and no format arguments [-Wformat-security] if (n%4==1) fprintf(g,2); ^ lan.cpp:12:30: error: invalid conversion from 'int' to 'const char*' [-fpermissive] if(n%4==2) fprintf(g,4); ^ In file included from /usr/include/stdio.h:937:0, from lan.cpp:1: /usr/include/i386-linux-gnu/bits/stdio2.h:95:1: error: initializing argument 2 of 'int fprintf(FILE*, const char*, ...)' [-fpermissive] fprintf (FILE *__restrict __stream, const char *__restrict __fmt, ...) ^ lan.cpp:12:30: warning: format not a string literal and no format arguments [-Wformat-security] if(n%4==2) fprintf(g,4); ^ lan.cpp:13:30: error: invalid conversion from 'int' to 'const char*' [-fpermissive] if(n%4==3) fprintf(g,8); ^ In file included from /usr/include/stdio.h:937:0, from lan.cpp:1: /usr/include/i386-linux-gnu/bits/stdio2.h:95:1: error: initializing argument 2 of 'int fprintf(FILE*, const char*, ...)' [-fpermissive] fprintf (FILE *__restrict __stream, const char *__restrict __fmt, ...) ^ lan.cpp:13:30: warning: format not a string literal and no format arguments [-Wformat-security] if(n%4==3) fprintf(g,8); ^ lan.cpp:14:30: error: invalid conversion from 'int' to 'const char*' [-fpermissive] if(n%4==0) fprintf(g,6); ^ In file included from /usr/include/stdio.h:937:0, from lan.cpp:1: /usr/include/i386-linux-gnu/bits/stdio2.h:95:1: error: initializing argument 2 of 'int fprintf(FILE*, const char*, ...)' [-fpermissive] fprintf (FILE *__restrict __stream, const char *__restrict __fmt, ...) ^ lan.cpp:14:30: warning: format not a string literal and no format arguments [-Wformat-security] if(n%4==0) fprintf(g,6); ^ lan.cpp:7:24: warning: ignoring return value of 'int fscanf(FILE*, const char*, ...)', declared with attribute warn_unused_result [-Wunused-result] fscanf(f, "%d", &n); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema 2lan 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ă.