#2980
valutar
Valutar este un joc care poate fi jucat de oricâți jucători. La începutul jocului, fiecare jucător primește L
lei și E
euro, precum și un jeton numerotat cu numărul jucătorului. Scrieți un program care să rezolve următoarele cerințe:
1. determină numărul de jucători existenți în joc după X
mutări;
2. determină jucătorul care a rămas în joc și care are cea mai mare sumă de Euro după X
mutări.
Problema | valutar | Operații I/O |
valutar.in /valutar.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 8 MB
/
Stivă 4 MB
|
Id soluție | #42489232 | Utilizator | |
Fișier | valutar.c | Dimensiune | 1.77 KB |
Data încărcării | 07 Martie 2023, 21:17 | Scor / rezultat | Eroare de compilare |
valutar.c: In function 'main': valutar.c:21:5: warning: array subscript has type 'char' [-Wchar-subscripts] tipdinlit[litdintip[i]] = i; ^ valutar.c:23:7: error: incompatible types when assigning to type 'FILE' from type 'struct FILE *' fin = fopen( "valutar.in", "r" ); ^ valutar.c:24:3: error: incompatible type for argument 1 of 'fscanf' fscanf( fin, "%d%d%d%d%d%d%d%d%d ", &c, &a, &b, &zar, &n, &m, &l, &e, &x ); ^ In file included from /usr/include/features.h:374:0, from /usr/include/stdio.h:27, from valutar.c:1: /usr/include/stdio.h:443:12: note: expected 'struct FILE * restrict' but argument is of type 'FILE' extern int __REDIRECT (fscanf, (FILE *__restrict __stream, ^ valutar.c:26:5: error: incompatible type for argument 1 of 'fgetc' casa[i][0] = tipdinlit[fgetc( fin )]; ^ In file included from valutar.c:1:0: /usr/include/stdio.h:531:12: note: expected 'struct FILE *' but argument is of type 'FILE' extern int fgetc (FILE *__stream); ^ valutar.c:27:5: error: incompatible type for argument 1 of 'fscanf' fscanf( fin, "%d%d ", &casa[i][1], &casa[i][2] ); ^ In file included from /usr/include/features.h:374:0, from /usr/include/stdio.h:27, from valutar.c:1: /usr/include/stdio.h:443:12: note: expected 'struct FILE * restrict' but argument is of type 'FILE' extern int __REDIRECT (fscanf, (FILE *__restrict __stream, ^ valutar.c:29:3: error: incompatible type for argument 1 of 'fclose' fclose( fin ); ^ In file included from valutar.c:1:0: /usr/include/stdio.h:237:12: note: expected 'struct FILE *' but argument is of type 'FILE' extern int fclose (FILE *__stream); ^ valutar.c:75:8: error: incompatible types when assigning to type 'FILE' from type 'struct FILE *' fout = fopen( "valutar.out", "w" ); ^ valutar.c:76:3: error: incompatible type for argument 1 of 'fprintf' fprintf( fout, "%d\n", njoc ); ^ In file included from /usr/include/stdio.h:937:0, from valutar.c:1: /usr/include/i386-linux-gnu/bits/stdio2.h:95:1: note: expected 'struct FILE * restrict' but argument is of type 'FILE' fprintf (FILE *__restrict __stream, const char *__restrict __fmt, ...) ^ valutar.c:77:3: error: incompatible type for argument 1 of 'fclose' fclose( fout ); ^ In file included from valutar.c:1:0: /usr/include/stdio.h:237:12: note: expected 'struct FILE *' but argument is of type 'FILE' extern int fclose (FILE *__stream); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema valutar 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ă.