Révision 333
Ajouté par Papa Abdoulaye NDIAYE il y a presque 3 ans
branch/papa_ndiaye/sp4a12/main.c | ||
---|---|---|
}
|
||
float decode_lattitude(char * ch)
|
||
{
|
||
int pos=17;
|
||
int pos=0,pos1,i=0,m=0;
|
||
while(m==0 && pos<strlen(*ch))
|
||
{
|
||
|
||
if(ch[pos]=',')
|
||
{
|
||
pos1++;
|
||
if(pos1==3)
|
||
m=1;
|
||
}
|
||
pos++;
|
||
|
||
}
|
||
|
||
float s,s1=0,s2=0,s3=0;
|
||
for(i=pos;i<pos+2;i++)
|
||
s1=s1+ decode_int(ch[i])*pow(10,pos+1-i);
|
||
for(i=pos+2;i<pos+4;i++)
|
||
... | ... | |
for(i=pos+5;i<pos+7;i++)
|
||
s3=s3+ decode_int(ch[i])*pow(10,pos+6-i)/3600;
|
||
|
||
return s=s1+s2+s3 ;
|
||
|
||
}
|
||
|
||
float decode_longitude(char * ch)
|
||
{
|
||
int pos=0,pos1=0,i=0,m=0;
|
||
while(m==0 && pos<strlen(*ch))
|
||
{
|
||
|
||
if(ch[pos]=',')
|
||
{
|
||
pos1++;
|
||
if(pos1==5)
|
||
m=1;
|
||
}
|
||
pos++;
|
||
}
|
||
float s,s1=0,s2=0;
|
||
for(i=pos;i<pos+3;i++)
|
||
s1=s1+ decode_int(ch[i])*pow(10,pos+1-i);
|
||
for(i=pos+2;i<pos+4;i++)
|
||
s2=s2+ decode_int(ch[i])*pow(10,pos+3-i)/60;
|
||
|
||
|
||
}
|
||
|
||
|
Formats disponibles : Unified diff
rectification 7 et question 8 faite