Pagini recente » Cod sursa (job #1287368) | Cod sursa (job #2725126) | Cod sursa (job #1139108) | Cod sursa (job #2882077) | Cod sursa (job #3162503)
#include <bits/stdc++.h>
using namespace std;
ifstream fin("grozavesti.in");
ofstream fout("grozavesti.out");
struct str{
int val;
int ind;
};
int fun(str A, str B)
{
if(A.val < B.val)
{
fout << "L " << A.ind << ' ' << A.ind-1 << '\n';
fout << "C " << A.ind << ' ' << A.ind-1 << '\n';
return 1;
}
return 0;
}
int n, x, r;
str col[301];
int main()
{
ios::sync_with_stdio(false);
fin.tie(NULL);
fout.tie(NULL);
fin >> n;
for(int i=1; i<=n; i++)
{
for(int j=1; j<=n; j++)
{
fin >> x;
if(i==j)
col[r++]={x, i};
}
}
sort(col,col+r,fun);
fin.close();
fout.close();
return 0;
}