Cod sursa(job #499853)
| Utilizator | Data | 10 noiembrie 2010 22:04:07 | |
|---|---|---|---|
| Problema | Lacate | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.58 kb |
#include <fstream>
02.#define nmax 260
03.
04.using namespace std;
05.
06.int a[nmax][nmax],n,i,j,nr;
07.
08.int main() {
09. ifstream f("lacate.in");
10. ofstream g("lacate.out");
11. f>>n;
12. g<<(n-1)*n/2<<" "<<n-1<<endl;
13. for (i=1; i<=n; i++) {
14.
15. for (j=1; j<=n; j++)
16. if (i!=j) {
17. if (j>i) {
18. nr++;
19. a[i][j]=a[j][i]=nr;
20. }
21. g<<a[i][j]<<" ";
22. }
23. g<<endl;
24. }
25. return 0;
26.}
