hii at all i was solving an adhoc problem on uva judge link -
http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&category=121&problem=208&mosmsg=Submission+received+with+ID+8477913
and hers my code for the problem but i get wrong answer every tme
plzzz help me debug the code i dnt think i have missed any test case
the code is as follows
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<algorithm>
#include<vector>
using namespace std;
int main()
{
char str[10000];// string of characters
int i,j,k;// counter variables
int len;// stores the length of the string
while(gets(str)!=NULL)
{
len=strlen(str);
vector<char>v;
j=0;
k=0;
for(i=0;i<len;i++)
{
if(str[i]==34)
{
++j;
if(j%2!=0)
{
v.push_back(96);
v.push_back(96);
}
else
{
v.push_back(39);v.push_back(39);
}
}
else
{
v.push_back(str[i]);
}
}
vector<char>::iterator p;
p=v.begin();
while(p!=v.end())
{
cout<<*p;
++p;
}
v.clear();
cout<<endl;
}
getchar();
getchar();
return 0;
}
thnx in advance
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.