#4294
Se dă un număr natural nenul n. Afișați toate perechile x y cu proprietatea că x + y = n și 0 < x ≤ y.
| Problema | perechiN | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64831272 | Utilizator | |
| Fișier | perechin.cpp | Dimensiune | 247 B |
| Data încărcării | 04 Iunie 2026, 12:40 | Scor/rezultat | Eroare de compilare |
perechin.cpp: In function ‘int main()’: perechin.cpp:13:14: warning: suggest parentheses around assignment used as truth value [-Wparentheses] 13 | for(i=1;j=n-1;i<=j;i++;j--;) | ~^~~~ perechin.cpp:13:20: warning: for increment expression has no effect [-Wunused-value] 13 | for(i=1;j=n-1;i<=j;i++;j--;) | ~^~~ perechin.cpp:13:23: error: expected ‘)’ before ‘;’ token 13 | for(i=1;j=n-1;i<=j;i++;j--;) | ~ ^ | ) perechin.cpp:13:5: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 13 | for(i=1;j=n-1;i<=j;i++;j--;) | ^~~ perechin.cpp:13:24: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 13 | for(i=1;j=n-1;i<=j;i++;j--;) | ^ perechin.cpp:13:32: error: expected primary-expression before ‘)’ token 13 | for(i=1;j=n-1;i<=j;i++;j--;) | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema perechiN 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ă.