I've been trying to solve this for quite a few times now but the Judge repeatedly says Wrong Answer. The problem seems pretty straight forward and I've tried all the base cases and worst cases,limits and Ideone.com gives a successfull compilation so right now I've no idea what's wrong with the code. Anyone out there help me. The problem is from the Basic Category and the link's Act1,character patterns.
int main(){
int num(0);
int row[100],col[100];
cout<<"enter num of test cases:";
cin>>num;
cout<<endl;
if(num<100 && num>0){
for(int j(0);j<num;++j){
cout<<"enter num of rows:";
cin>>row[j];
cout<<"enter num of cols:";
cin>>col[j];
}
for(int k(0);k<num;++k){
for(int ir(0);ir<row[k];++ir){
for(int ic(0);ic<col[k];++ic){
if(ir%2 == 0){
if((ic%2==0)){
cout<<'*';
}else{
cout<<'.';
}
}else{
if((ic%2==0)){
cout<<'.';
}else{
cout<<'*';
}
}
}
cout<<endl;
}
cout<<endl;
}
}
return 0;
}