Page 1 of 4
10197 - Learning Portuguese
Posted: Thu Jan 30, 2003 2:25 am
by amd-RS
Hi all,
Could you give me some test cases, I don know why I get wrong answer
Thanks, Aur
p10197
Posted: Thu Mar 27, 2003 8:44 am
by sumankar
it seems no one is intt in this one
me too got same problem,
we can swap codes I guess,
i/p is trivial it seems,
mail me
srbr@hotmail.com
10197
Posted: Fri Apr 18, 2003 7:13 pm
by sumankar
#include<stdio.h>
#include<string.h>
int radical(char conj[],char *tv,char *last)
{
if ( strlen(conj) >= 2 ) {
*last = conj[strlen(conj)-1];
*tv = conj[strlen(conj)-2];
conj[strlen(conj)-2] = '\0';
return 1;
}
return -1;
}
int main()
{
char verb[31],tv,trans[31],lst;
while ( scanf("%s %s",verb,trans) == 2 ) {
printf("%s (to %s)\n",verb,trans);
radical( verb,&tv,&lst);
if( lst == 'r' && (tv == 'a' || tv == 'e' || tv == 'i') ) {
printf("eu %so\n",verb);
printf("tu %s%cs\n",verb,tv=='i'?'e':tv);
printf("ele/ela %s%c\n",verb,tv=='i'?'e':tv);
printf("n%cs %s%cmos\n",243,verb,tv);
printf("v%cs %s%c%cs\n",243,verb,tv,tv=='i'?'\0':'i');
printf("eles/elas %s%cm\n",verb,tv=='i'?'e':tv);
}
else printf("Unknown conjugation\n");
printf("\n");
}
return 0;
}
Code: Select all
[c]
whats wrong
someone plz plz help me,
thnx in advance[/c]
10197
Posted: Sat Jun 28, 2003 6:06 am
by Daredevil
#include<stdio.h>
#include<string.h>
int l,c;
char v1[50],v2[50],t;
void main(){
while(scanf("%s",&v1)!=EOF){
gets(v2);
printf("%s (to%s)\n",v1,v2);
l=strlen(v1)-1;
if(v1[l]=='r'){
if(v1[l-1]=='a'||v1[l-1]=='e'||v1[l-1]=='i') {
t=v1[l-1];v1[l-1]=0;
if(t=='i') c=1;
}
}
if(!v1[l-1]){
printf("eu %so\n",v1);
if(!c){
printf("tu %s%cs\n",v1,t);
printf("ele/ela %s%c\n",v1,t);
printf("n%cs %s%cmos\n",243,v1,t);
printf("v%cs %s%cis\n",243,v1,t);
printf("eles/elas %s%cm",v1,t);
}
else {
printf("tu %ses\n",v1);
printf("ele/ela %se\n",v1);
printf("n%cs %s%cmos\n",243,v1,t);
printf("v%cs %s%cs\n",243,v1,t);
printf("eles/elas %sem",v1);c=0;
}
}
else printf("Unknown conjugation");
printf("\n\n");
}
}[/c]
10197 :please help me I'm, frustrated !!
Posted: Wed Sep 24, 2003 5:52 pm
by sumankar
give me a hint
at least
what can be a tricky i/p?? javascript:emoticon(':(')
10197:Portuguese Verbs et al
Posted: Fri Sep 26, 2003 5:11 pm
by sumankar
Just what am I supposed to do
in order to get someone (yes someone!!)
help me out a little bit?
Nobody seems to be bothered by this problem.
Please !!
Posted: Fri Sep 26, 2003 7:06 pm
by little joey
Hmm.
It helps to place this question in the right forum.
Try to get someone's attention by asking the right question

. Just asking for help or plainly dumping WA code will trigger no one. State what you already got and where specificly your problem lies.
Or you can always PM people high in the rankings, but there the same applies as in the forums. They get quite a lot of help requests, so your question's got to sick out somehow to get answered.
10197
Posted: Sat Sep 27, 2003 5:13 pm
by sumankar
Thnx joey.
Well I tried the forum.
Twice , lots of views but replies = 0 .
So i got freaked out a little.
Sorry if I ve offended anyone.
My problem is :
is there some sort of nasty i/o (the input set )
that is hard to come up with for someone like me
who's new into this kind of coding that might crash the
program .The problem hardly seems like one.
1)i do a getline to incorporate verbs wiith spaces.
2)no idea what to print for a blank line(so i print a blank line)
3) since no special symbols are used(prob desc)
what else can fail it with a WA??
Thnx in advance
(last time I'm misusing this thread javascript:emoticon('

'))
suman.
Posted: Sat Sep 27, 2003 5:35 pm
by little joey
I don't think there's any dirty input.
1) looks good
2) I don't take care of blank lines, so they're probably not there, but I handle more than one space between the protuguese and english verb (don't know if there are such cases).
3) no special symbols are used in the input, but the output contains ascii 243
PM me your code if you want me to take a look at it.
Posted: Sat Sep 27, 2003 11:02 pm
by playerX
hi, I got this accepted, but I also went a bit mad.
I don't know if this is happening to you but this was my mistake:
verb: amar
(it would be a well formed verb)
verb: amav
(it should be invalid)
I was just checking the character before the last and wasn't making sure the last needed to be 'r', hope this helps.
* I'm Portuguese

10197
Posted: Sun Sep 28, 2003 7:53 am
by sumankar
well i was a little less lazy
i check last two chars
anyway how does it matter if the verb is, say
(wiith due apologies to portuguese grammaticians!!)
amarar?
BTW:i have a very li'll knowledge of french(i banked on that)
suman.
Posted: Mon Sep 29, 2003 10:57 pm
by playerX
well, no special cases here, "amarar" has no sense in portuguese but no special case is defined on the statement...
make sure you are using the right character on those "
10197 WA
Posted: Sat Oct 18, 2003 2:10 pm
by sohel
HI,
This problem looks straight forward but I keep getting WA. Can somebody give me any critical inputs. Thanks.
Posted: Thu Oct 23, 2003 7:37 am
by Joseph Kurniawan
Hi sohel,
there's no critical input for this prob. Maybe you should show your code so I can examine it!!

Thanks!
Posted: Mon Oct 27, 2003 12:22 pm
by sohel
I finally got AC.
My problem was that I consdered two lettered portugese words as having no conjugation. But in this program this is not so.
I guess those who knows portugese found this problem very easy.
But thanks anyway , Joseph.
---------------------------------------------------------------------------
Those who memorizes (without understanding) does well in exams, but suffers in ACM programs. But it is the problem solving ability that counts.