| View previous topic :: View next topic |
| Author |
Message |
maybe may be
Joined: 21 Sep 2005 Posts: 4833
|
Posted: Tue Dec 04, 2007 5:08 pm Post subject: |
|
|
| Aneisse wrote: |
Eu...aaaa.......Primiti cu colindu'? | numa sa nu-mi ceri bani
so:  |
|
| Back to top |
|
 |
Reclama
|
Posted: Post subject: Acorda-ne putina atentie |
|
|
|
|
|
| Back to top |
|
 |
selen diamond member


Joined: 25 Jun 2007 Posts: 994 Location: in privirea ta
|
Posted: Tue Dec 04, 2007 9:23 pm Post subject: |
|
|
| buna seara tuturor! |
|
| Back to top |
|
 |
jolie_jojo irecuperabila

Joined: 28 Nov 2006 Posts: 5725 Location: La Cuca Macaii :D
|
Posted: Tue Dec 04, 2007 9:31 pm Post subject: |
|
|
Buna Micutzo  _________________ Hai si tu la discutii in cafenea ! intra pe http://cafenea.itbox.ro |
|
| Back to top |
|
 |
selen diamond member


Joined: 25 Jun 2007 Posts: 994 Location: in privirea ta
|
Posted: Tue Dec 04, 2007 9:32 pm Post subject: |
|
|
| ce faceti? eu cam rau...ma chinui sa inteleg o problema si nu imi iese nik. adio olimpiada... |
|
| Back to top |
|
 |
jolie_jojo irecuperabila

Joined: 28 Nov 2006 Posts: 5725 Location: La Cuca Macaii :D
|
Posted: Tue Dec 04, 2007 9:33 pm Post subject: |
|
|
Baga problema ... sa ne dam si noi cu presupusul  _________________ Hai si tu la discutii in cafenea ! intra pe http://cafenea.itbox.ro |
|
| Back to top |
|
 |
selen diamond member


Joined: 25 Jun 2007 Posts: 994 Location: in privirea ta
|
Posted: Tue Dec 04, 2007 9:34 pm Post subject: |
|
|
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#define InFile "ecuatii.in"
#define OutFile "ecuatii.out"
#define LgMax 300
char s[LgMax],s1[LgMax],s2[LgMax];
int n;
long nr1, nr2, nrx1, nrx2;
void rezolva(char *, long &, long &);
int main()
{
FILE * fin=fopen(InFile,"r");
FILE * fout=fopen(OutFile,"w");
int i;
char *p;
fscanf(fin,"%d", &n);
for (i=0; i<n; i++)
{
fscanf(fin,"%s", s1);
p=strchr(s1,'=');
strcpy(s2,p+1);
*p=NULL;
rezolva(s1, nr1, nrx1);
rezolva(s2, nr2, nrx2);
if (nrx1==nrx2)
if (nr1==nr2)
fprintf(fout,"infinit\n");
else
fprintf(fout,"imposibil\n");
else
fprintf(fout,"%.4lf\n",((double)(nr2-nr1)/(nrx1-nrx2)));
}
fclose(fin);
fclose(fout);
return 0;
}
void rezolva(char *s, long &nr, long &nrx)
{char *p, ss[LgMax];
long v;
int semn=1, l;
strcpy(ss,s);
p=strtok(ss,"+-");
nr=0; nrx=0;
while (p)
{
l=strlen(p);
if (p[0]=='x') nrx+=semn;
else
if (p[l-1]=='x')
{p[l-1]=NULL;
v=atol(p);
nrx=nrx+semn*v;
}
else
{v=atol(p);
nr=nr+semn*v;}
if (s[p+l-ss]=='+')
semn=1;
else
semn=-1;
p=strtok(NULL, "+-");
}
}
 |
|
| Back to top |
|
 |
jolie_jojo irecuperabila

Joined: 28 Nov 2006 Posts: 5725 Location: La Cuca Macaii :D
|
Posted: Tue Dec 04, 2007 9:36 pm Post subject: |
|
|
vb de C++ ???  _________________ Hai si tu la discutii in cafenea ! intra pe http://cafenea.itbox.ro |
|
| Back to top |
|
 |
selen diamond member


Joined: 25 Jun 2007 Posts: 994 Location: in privirea ta
|
Posted: Tue Dec 04, 2007 9:37 pm Post subject: |
|
|
cam asa ceva  |
|
| Back to top |
|
 |
jolie_jojo irecuperabila

Joined: 28 Nov 2006 Posts: 5725 Location: La Cuca Macaii :D
|
Posted: Tue Dec 04, 2007 9:39 pm Post subject: |
|
|
Si ce nu iese defapt?? Nu ruleaza ce trebuie imediat ce introduci programul?? sau....?? _________________ Hai si tu la discutii in cafenea ! intra pe http://cafenea.itbox.ro |
|
| Back to top |
|
 |
selen diamond member


Joined: 25 Jun 2007 Posts: 994 Location: in privirea ta
|
Posted: Tue Dec 04, 2007 9:41 pm Post subject: |
|
|
ruleaza ca e luata de pe net dar nu inteleg nik din ce scrie acolo.... si e problema de anu trecut de la a 10a de la olimpiada  |
|
| Back to top |
|
 |
selen diamond member


Joined: 25 Jun 2007 Posts: 994 Location: in privirea ta
|
Posted: Tue Dec 04, 2007 10:31 pm Post subject: |
|
|
ce va tot certati acolo jos? iar pe mine ma lasati aici singura...  |
|
| Back to top |
|
 |
jolie_jojo irecuperabila

Joined: 28 Nov 2006 Posts: 5725 Location: La Cuca Macaii :D
|
Posted: Tue Dec 04, 2007 10:32 pm Post subject: |
|
|
Si tu incepi? Nu ma cert mey...incerc  _________________ Hai si tu la discutii in cafenea ! intra pe http://cafenea.itbox.ro |
|
| Back to top |
|
 |
selen diamond member


Joined: 25 Jun 2007 Posts: 994 Location: in privirea ta
|
Posted: Tue Dec 04, 2007 10:33 pm Post subject: |
|
|
eu nu incep cu nimic draga  |
|
| Back to top |
|
 |
Sweety Big Diamond

Joined: 14 Aug 2005 Posts: 3200
|
Posted: Wed Dec 05, 2007 12:02 am Post subject: |
|
|
Sel sa nu fii lenesa , dejaba postezi nu iti rezolvam nici o problema ...  _________________ Oh I wish I was a punk rocker with flowers in my hair |
|
| Back to top |
|
 |
tuffgirl can't touch this

Joined: 10 Feb 2005 Posts: 4571 Location: ;)
|
Posted: Wed Dec 05, 2007 12:14 am Post subject: |
|
|
Ce rea te-ai facut tu  _________________ Those who wish to appear wise among fools, among the wise seem foolish.
- Quintilian, De Institutione Oratoria |
|
| Back to top |
|
 |
Reclama
|
Posted: Post subject: Acorda-ne putina atentie |
|
|
|
|
|
| Back to top |
|
 |
|