Αρχίζω:
Κώδικας: Επιλογή όλων
/*LANG:C++
TASK: Alexander*/
#include<fstream>
#include <stdlib.h>
using namespace std;
int main(){
register short int line,col,cl,cc;
register char s1='P',s2='V',pvpv='\0',*point,*point2,*line1,*line2;
char check;
ifstream inpy("Alexander.in");
ofstream outy("Alexander.out");
inpy >> line >> col >> check;
inpy.close();
if(check=='V')pvpv++;
line1=(char*)malloc((col+2);
if((line1==NULL)) return 0;
line2=(char*)malloc((col+2);
if((line2==NULL)) return 0;
point=line1;
point2=line2;
for(cc=0;cc<col;cc++)
{if(pvpv%2){*point=s2;*point2=s1;}else{*point=s1;*point2=s2;}
point++;
point2++;
pvpv++;}
*point='\n';
*point2='\n';
point++;
point2++;
*point='\0';
*point2='\0';
pvpv='\0';
for(cl=0;cl<line;cl++)
{if(pvpv%2){outy<<line2;}else{outy<<line1;}
pvpv++;}
outy.close();
return 0;}