#include #include #include #include using namespace std; ifstream fin("date.in"); ofstream fout("date.out"); int n; bool mat[105][105]; string m[105], cop; bool cmp(string a, string b) { return a.size() > b.size(); } void afis() { for(int i =1 ;i<=n;i++){ for(int j=0;j> n; for(int i = 1; i <= n; i++) { cin >> m[i]; } sort(m + 1, m + n + 1, cmp); string a = "ABCDEFG"; // cout << a.erase(2,3); for(int i = 1; i <= n; i++) { for(int j = i + 1; j <= n; j++) { int poz = m[i].find(m[j]); string cop = m[i]; if(poz < 105 && poz >= 0) { //cout << m[i] << ' '<= 0) { for(int k = poz; k < poz + m[j].size();k++) { mat[i][k + lastpoz] = 1; } lastpoz += m[j].size(); cop = cop.erase(poz,m[j].size()); //cout << " "<