快捷导航

求助,急急急

编写C语言程序:
给定一个rSquare,表示一个圆的半径的平方。某元的圆心在坐标系原点,计算返回处在该圆圆周上的格点

免责声明:本内容仅代表回答者见解不代表本站观点,请谨慎对待。

版权声明:作者保留权利,不代表本站立场。

回复

使用道具 举报

参与会员2

#include
#include
int main()
{
        float rSquare;
        int x,y,temp,res,count = 0;
        scanf("%f",&rSquare);
        x=(int)sqrt(rSquare);
        y=(int)sqrt(rSquare);

        for(int i=0;i
回复

使用道具 举报

Java版本:
publicstaticintcountPoints(intrSquare){if(rSquare=1){intx,y,temp,res,count=0;x=(int)Math.sqrt(rSquare);y=(int)Math.sqrt(rSquare);for(inti=0;i
回复

使用道具 举报

可能感兴趣的问答

发新帖
  • 微信访问
  • 手机APP