#include #include #include #include using namespace std; bool pal(string n) { for(int i=1;i> l; for(int j=0;j<50;j++) { if(l[j]<='9') { max++; } } } in.close(); cout << max << endl; cout << endl; cout << "zad 2" << endl; string f; int kol=0; ifstream in2("napisy.txt"); for(int i=1;i<1001;i++) { in2 >> f; if(i%20==0) { cout << f[kol]; kol++; } } in2.close(); cout << endl << endl; string h; cout << "zad 3" << endl; ifstream in3("napisy.txt"); for(int i=0;i<1000;i++) { in3 >> h; if(pal(h)==true or pal2(h)==true) { if(pal2(h)==true) { cout << h[24]; } else { cout << h[25]; } } } cout << endl; in3.close(); cout << endl; cout << "zad 4" << endl; int g=0; string temp; string b; int v=0; bool po=true; ifstream in4("napisy.txt"); for(int i=0;i<1000;i++) { in4 >> b; for(int j=0;j<50;j++) { if(b[j]<='9') { g=g*10+(b[j]-48); if(g>10 and g<65) { g=0; } else if (g>10 and (po)) { temp[v]=g; cout << temp[v]; g=0; if((temp[v]=='X') and (temp[v-1]=='X' )and (temp[v-2]=='X')) { po=false; } v++; } } } g=0; } in4.close(); return 0; }