Cod sursa(job #2855131)

Utilizator alextheseal1240Alex Vladu alextheseal1240 Data 22 februarie 2022 09:45:48
Problema Dame Scor 50
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.43 kb
#include <iostream>
#include <fstream>
using namespace std;
ifstream fin("dame.in");
ofstream fout("dame.out");
int i=1, j=2, n;
void read()
{
    fin >> n;
    fout << n << "\n";
    while(j<=n)
    {
        fout << i << " " << j << "\n";
        i++, j+=2;
    }
    j=1;
    while(j<=n && i<=n)
    {
        fout << i << " " << j << "\n";
        i++, j+=2;
    }
}
int main()
{
    read();
    return 0;
}