#597
Poza
Fie o poză dată sub forma unei matrice cu n
linii și m
coloane, în care elementele sunt 0
sau 1
: un element 0
reprezintă fundalul imaginii, iar un element 1
reprezintă obiect din prim plan. Este necesară tăierea unei bucăți din imagine astfel încât:
Determinați dimensiunile pozei tăiate, precum și conținutul ei.
Problema | Poza | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #19212663 | Utilizator | |
Fișier | poza.c | Dimensiune | 1.23 KB |
Data încărcării | 30 Noiembrie 2019, 20:48 | Scor / rezultat | Eroare de compilare |
poza.c: In function 'main': poza.c:8:5: error: 'for' loop initial declarations are only allowed in C99 mode for(int i=1; i<=n; i++) ^ poza.c:8:5: note: use option -std=c99 or -std=gnu99 to compile your code poza.c:9:9: error: 'for' loop initial declarations are only allowed in C99 mode for(int j=1; j<=m; j++) ^ poza.c:11:13: error: redefinition of 'i' for(int i=1; i<=n,ok==0; i++) ^ poza.c:8:13: note: previous definition of 'i' was here for(int i=1; i<=n; i++) ^ poza.c:11:5: error: 'for' loop initial declarations are only allowed in C99 mode for(int i=1; i<=n,ok==0; i++) ^ poza.c:11:22: warning: left-hand operand of comma expression has no effect [-Wunused-value] for(int i=1; i<=n,ok==0; i++) ^ poza.c:13:9: error: 'for' loop initial declarations are only allowed in C99 mode for(int j=1; j<=m,ok==0; j++) ^ poza.c:13:26: warning: left-hand operand of comma expression has no effect [-Wunused-value] for(int j=1; j<=m,ok==0; j++) ^ poza.c:21:13: error: redefinition of 'i' for(int i=n; i>=1,ok==0; i--) ^ poza.c:11:13: note: previous definition of 'i' was here for(int i=1; i<=n,ok==0; i++) ^ poza.c:21:5: error: 'for' loop initial declarations are only allowed in C99 mode for(int i=n; i>=1,ok==0; i--) ^ poza.c:21:22: warning: left-hand operand of comma expression has no effect [-Wunused-value] for(int i=n; i>=1,ok==0; i--) ^ poza.c:23:9: error: 'for' loop initial declarations are only allowed in C99 mode for(int j=1; j<=m,ok==0; j++) ^ poza.c:23:26: warning: left-hand operand of comma expression has no effect [-Wunused-value] for(int j=1; j<=m,ok==0; j++) ^ poza.c:31:13: error: redefinition of 'j' for(int j=1; j<=m,ok==0; j++) ^ poza.c:9:17: note: previous definition of 'j' was here for(int j=1; j<=m; j++) ^ poza.c:31:5: error: 'for' loop initial declarations are only allowed in C99 mode for(int j=1; j<=m,ok==0; j++) ^ poza.c:31:22: warning: left-hand operand of comma expression has no effect [-Wunused-value] for(int j=1; j<=m,ok==0; j++) ^ poza.c:32:17: error: redefinition of 'i' for(int i=1; i<=n,ok==0; i++) ^ poza.c:21:13: note: previous definition of 'i' was here for(int i=n; i>=1,ok==0; i--) ^ poza.c:32:9: error: 'for' loop initial declarations are only allowed in C99 mode for(int i=1; i<=n,ok==0; i++) ^ poza.c:32:26: warning: left-hand operand of comma expression has no effect [-Wunused-value] for(int i=1; i<=n,ok==0; i++) ^ poza.c:40:13: error: redefinition of 'j' for(int j=m; j>=1,ok==0; j--) ^ poza.c:31:13: note: previous definition of 'j' was here for(int j=1; j<=m,ok==0; j++) ^ poza.c:40:5: error: 'for' loop initial declarations are only allowed in C99 mode for(int j=m; j>=1,ok==0; j--) ^ poza.c:40:22: warning: left-hand operand of comma expression has no effect [-Wunused-value] for(int j=m; j>=1,ok==0; j--) ^ poza.c:41:17: error: redefinition of 'i' for(int i=1; i<=n,ok==0; i++) ^ poza.c:32:17: note: previous definition of 'i' was here for(int i=1; i<=n,ok==0; i++) ^ poza.c:41:9: error: 'for' loop initial declarations are only allowed in C99 mode for(int i=1; i<=n,ok==0; i++) ^ poza.c:41:26: warning: left-hand operand of comma expression has no effect [-Wunused-value] for(int i=1; i<=n,ok==0; i++) ^ poza.c:50:13: error: redefinition of 'i' for(int i=imin+1; i<imax; i++) ^ poza.c:41:17: note: previous definition of 'i' was here for(int i=1; i<=n,ok==0; i++) ^ poza.c:50:5: error: 'for' loop initial declarations are only allowed in C99 mode for(int i=imin+1; i<imax; i++) ^ poza.c:52:9: error: 'for' loop initial declarations are only allowed in C99 mode for(int j=jmin+1; j<=jmax; j++) ^ poza.c:7:10: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result] scanf("%d%d",&n,&m); ^ poza.c:10:18: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result] scanf("%d",&a[i][j]); ^ poza.c:57:1: warning: control reaches end of non-void function [-Wreturn-type] } ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Poza 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ă.