Search found 2 matches

by koola
Sun Nov 03, 2002 4:06 am
Forum: Volume 102 (10200-10299)
Topic: 10221 - Satellites
Replies: 34
Views: 13231

10221 a easy problem,but why wrong answer?

#include<iostream.h> #include<math.h> #include<stdio.h> #define pi 3.1415926535897932384626433832795 void main() { double arc,chord; char ch[4]; long s; double a; long r; r = 6440; while(cin>>s>>a>>ch) { if(ch[0]=='m') a = a/60; while (a >= 360.0) { a -= 360.0; } a = pi*a/180; chord = sin (a/2)*(r+...
by koola
Wed Sep 25, 2002 10:44 am
Forum: Volume 100 (10000-10099)
Topic: 10013 - Super long sums
Replies: 212
Views: 39678

10013 why runtime error?

the code: #include<iostream.h> #include<stdio.h> #include<stdlib.h> void add(int x[],int y[],int m) { int dig,tag,z[10000],i; tag=0; for(i=0;i<m;i++) { dig=(x +y +tag)%10; tag=(x +y +tag)/10; z =dig; } for(i=m-1;i>=0;i--) {if((tag>0)&&(i==m-1)) cout<<tag; cout<<z ; } cout<<endl; cout<<endl; } void m...

Go to advanced search