check out this simple code....
t--testcase
n--no.of rows
m --no,of columns
Code:
#include<iostream>
#include<stdio.h>
#include<queue>
#include<vector>
#include<cstdio>
#define max 999999
#define maxedges 1009
#include<set>
using namespace std;
int main()
{
long long int t;
cin>>t;
char c[maxedges][maxedges];
static long long int i,j,n,m;
static long long int count=0;
while(t)
{
count=0;
cin>>m;
cin>>n;
for(i=0;i<n;i++)
{
for(j=0;j<m;j++)
{
//scanf("%c",&c[i][j]);
cin>>c[i][j];
if((c[i][j]=='.'))
{
count++;
}
}}
count=0;
for(i=0;i<n;i++)
{
for(j=0;j<m;j++)
{
cout<<c[i][j];
}
cout<<"\n";
}
t--;
}
return 0;
}
INPUT
1
7 6
#######
#.#.###
#.#.###
#.#.#.#
#.....#
#######
EXPECTED OUTPUT IS GOT USING CIN:
Code:
#######
#.#.###
#.#.###
#.#.#.#
#.....#
#######
but not got using scanf