DCP 169..Why WA???!!!

Dev Skill archived problems can be discussed here.

DCP 169..Why WA???!!!

by Sakib » Fri Mar 24, 2017 10:48 pm

#include<stdio.h>
#include<string.h>
int main()
{
int t,tc,row,col,ara1[10000],ara2[10000],i,j,l,k,m,n,found,count;
char str[10000],ch;
scanf("%d",&t);
for(tc=1;tc<=t;tc++)
{
found=0;k=0;count=0;
scanf("%d%d",&row,&col);
for(i=1;i<=row;i++)
{
scanf(" %[^\n]",str);
for(j=0;j<col;j++)
{
if(str[j]=='$')
{
found=1;
ara1[k]=i;
ara2[k]=j+1;
k++;
count++;
}

}
}
printf("Case %d:\n",tc);
if(found==1)
{
for(k=0;k<count;k++)
{
printf("%d,%d\n",ara1[k],ara2[k]);
}
}
else
printf("No Gold Found\n");

}
return 0;
}
 
Posts: 3
Joined: Tue Feb 28, 2017 7:40 pm

Re: DCP 169..Why WA???!!!

by mahrahat » Fri Mar 31, 2017 4:20 pm

I copied and pasted your code twice (first time adding space between %ds while reading row and column) and both were accepted! Probably there was some problem with OJ when you submitted code.
Lets
• search through previous topics before posting a new topic
• include link to problem (or at least problem number)
• write code snippets inside [code] [ /code] tags
 
Posts: 48
Joined: Thu Nov 24, 2016 9:11 pm
Location: Bangladesh

Re: DCP 169..Why WA???!!!

by Sakib » Sun Apr 02, 2017 10:28 pm

Thank You!! Accepted..
 
Posts: 3
Joined: Tue Feb 28, 2017 7:40 pm


Who is online
Users browsing this forum: No registered users and 2 guests
cron