fork(1) download
  1. #include <stdio.h>
  2. int main(void) {
  3. double S = 0.00000147;
  4. double speed = 0.000001;
  5.  
  6. for( int i = 0; i < 10; i++){
  7. S += speed;
  8. if((S > 0.000004) || (S < 0.000001))
  9. speed = -speed;
  10.  
  11. int l = 292.5-(S*1000000/4*226.5+0.5);
  12. int t = 181 -(S*1000000/4*226.5+0.5);
  13. int r = 292.5+(S*1000000/4*226.5+0.5);
  14. int b = 181 +(S*1000000/4*226.5+0.5);
  15.  
  16. printf( "S=%f, Ellipse(%3d,%3d,%3d,%3d)\n", S, l, t, r, b);
  17. }
  18. return 0;
  19. }
Success #stdin #stdout 0s 10320KB
stdin
Standard input is empty
stdout
S=0.000002, Ellipse(152, 40,432,321)
S=0.000003, Ellipse( 95,-15,489,377)
S=0.000004, Ellipse( 38,-72,546,434)
S=0.000003, Ellipse( 95,-15,489,377)
S=0.000002, Ellipse(152, 40,432,321)
S=0.000001, Ellipse(208, 97,376,264)
S=0.000000, Ellipse(265,153,319,208)
S=0.000001, Ellipse(208, 97,376,264)
S=0.000002, Ellipse(152, 40,432,321)
S=0.000003, Ellipse( 95,-15,489,377)