24小时热门版块排行榜    

查看: 1462  |  回复: 13
当前只显示满足指定条件的回帖,点击这里查看本话题的所有回帖

樱木三道

新虫 (著名写手)

[求助] 程序求助 已有1人参与

需要写一个程序:有两个圆,两个圆的圆心坐标,半径已知(先用常数代替),求两个圆两个交点相对于其中一个圆圆心的夹角。小弟实在不会写啊。
回复此楼
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

无知乱入

新虫 (初入文坛)

如果没有特别的需要 我感觉你还是用VC6比较好

发自小木虫Android客户端
8楼2018-07-16 12:17:50
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
查看全部 14 个回答

无知乱入

新虫 (初入文坛)

#include<stdio.h>
#include<math.h>
int main()
{
double a,b,c,d,e,f;
printf("请输入坐标及两半径\n";
scanf("%lf%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e,&f);
double x=fabs(a-c);
double y=fabs(b-d);
double j=sqrt(x*x+y*y);
if(j<1e-9)
{printf("输入错误\n";
return 0;
}
double h=e+f;
if(j<h)
{
double A;
if(e>f)
A=(f*f+j*j-e*e)/(2*j*f);
else
A=(e*e+j*j-f*f)/(2*j*e);
double ji=0;
ji=acos(A);
ji=2*ji/3.1415926*180;
printf("与小圆的夹角%lf\n",ji);
}
else
printf("两圆无交点";
return 0;
}

发自小木虫Android客户端

» 本帖已获得的红花(最新10朵)

2楼2018-07-16 00:00:08
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

樱木三道

新虫 (著名写手)

送红花一朵
引用回帖:
2楼: Originally posted by 无知乱入 at 2018-07-16 00:00:08
#include&lt;stdio.h&gt;
#include&lt;math.h&gt;
int main()
{
double a,b,c,d,e,f;
printf(&quot;请输入坐标及两半径\n&quot;
scanf(&quot;%lf%lf%lf%lf%lf%lf&quot;,&a ...

warning C4996: 'scanf': This function or variable may be unsafe. Consider using scanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>          c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(304) : 参见“scanf”的声明
1>c:\users\administrator\documents\visual studio 2010\projects\chengxu\chengxu\chengxu.c(8): error C2143: 语法错误 : 缺少“;”(在“类型”的前面)
1>c:\users\administrator\documents\visual studio 2010\projects\chengxu\chengxu\chengxu.c(9): error C2143: 语法错误 : 缺少“;”(在“类型”的前面)
1>c:\users\administrator\documents\visual studio 2010\projects\chengxu\chengxu\chengxu.c(10): error C2143: 语法错误 : 缺少“;”(在“类型”的前面)
1>c:\users\administrator\documents\visual studio 2010\projects\chengxu\chengxu\chengxu.c(11): error C2065: “j”: 未声明的标识符
1>c:\users\administrator\documents\visual studio 2010\projects\chengxu\chengxu\chengxu.c(15): error C2143: 语法错误 : 缺少“;”(在“类型”的前面)
1>c:\users\administrator\documents\visual studio 2010\projects\chengxu\chengxu\chengxu.c(16): error C2065: “j”: 未声明的标识符
1>c:\users\administrator\documents\visual studio 2010\projects\chengxu\chengxu\chengxu.c(16): error C2065: “h”: 未声明的标识符
1>c:\users\administrator\documents\visual studio 2010\projects\chengxu\chengxu\chengxu.c(20): error C2065: “j”: 未声明的标识符
1>c:\users\administrator\documents\visual studio 2010\projects\chengxu\chengxu\chengxu.c(20): error C2065: “j”: 未声明的标识符
1>c:\users\administrator\documents\visual studio 2010\projects\chengxu\chengxu\chengxu.c(20): error C2065: “j”: 未声明的标识符
1>c:\users\administrator\documents\visual studio 2010\projects\chengxu\chengxu\chengxu.c(22): error C2065: “j”: 未声明的标识符
1>c:\users\administrator\documents\visual studio 2010\projects\chengxu\chengxu\chengxu.c(22): error C2065: “j”: 未声明的标识符
1>c:\users\administrator\documents\visual studio 2010\projects\chengxu\chengxu\chengxu.c(22): error C2065: “j”: 未声明的标识符
1>c:\users\administrator\documents\visual studio 2010\projects\chengxu\chengxu\chengxu.c(23): error C2143: 语法错误 : 缺少“;”(在“类型”的前面)
1>c:\users\administrator\documents\visual studio 2010\projects\chengxu\chengxu\chengxu.c(24): error C2065: “ji”: 未声明的标识符
1>c:\users\administrator\documents\visual studio 2010\projects\chengxu\chengxu\chengxu.c(24): warning C4244: “=”: 从“double”转换到“int”,可能丢失数据
1>c:\users\administrator\documents\visual studio 2010\projects\chengxu\chengxu\chengxu.c(25): error C2065: “ji”: 未声明的标识符
1>c:\users\administrator\documents\visual studio 2010\projects\chengxu\chengxu\chengxu.c(25): error C2065: “ji”: 未声明的标识符
1>c:\users\administrator\documents\visual studio 2010\projects\chengxu\chengxu\chengxu.c(25): warning C4244: “=”: 从“double”转换到“int”,可能丢失数据
1>c:\users\administrator\documents\visual studio 2010\projects\chengxu\chengxu\chengxu.c(26): error C2065: “ji”: 未声明的标识符
1>
1>生成失败。
1>
1>已用时间 00:00:00.35
========== 生成: 成功 0 个,失败 1 个,最新 0 个,跳过 0 个 ==========
3楼2018-07-16 10:28:25
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

樱木三道

新虫 (著名写手)

引用回帖:
2楼: Originally posted by 无知乱入 at 2018-07-16 00:00:08
#include&lt;stdio.h&gt;
#include&lt;math.h&gt;
int main()
{
double a,b,c,d,e,f;
printf(&quot;请输入坐标及两半径\n&quot;
scanf(&quot;%lf%lf%lf%lf%lf%lf&quot;,&a ...

老哥,这是什么错误呢?
4楼2018-07-16 10:29:31
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[基金申请] 欢迎发来filecode的Mz6后的代码验证其规律 +14 医学老男孩 2026-08-13 34/1700 2026-08-14 09:21 by xiaruohan
[基金申请] FileCode能看出啥? +10 要乐观耀哥 2026-08-10 30/1500 2026-08-14 07:55 by 医学老男孩
[基金申请] 关于Filecode分析方法 +9 majunge000 2026-08-10 12/600 2026-08-13 23:20 by iwuli
[基金申请] 重要来源:本周末出结果 +10 瞬息宇宙 2026-08-12 10/500 2026-08-13 15:46 by likettle
[基金申请] Filecode 又变了,巨变 +3 WH3796 2026-08-12 4/200 2026-08-13 14:13 by 小木虫6752397
[基金申请] 2019年青年基金涵评意见,大家看看几个A,几个B? +11 Tide man 2026-08-11 11/550 2026-08-13 07:35 by 撸猫猫
[基金申请] 奇怪,两个人的filecode固定段从头到尾一模一样 +7 布布和一二 2026-08-10 10/500 2026-08-12 09:12 by 布布和一二
[基金申请] 综述论文作为代表作会不会影响评审专家的印象分? +11 yufeiwaner 2026-08-09 13/650 2026-08-12 08:17 by yufeiwaner
[基金申请] 帮忙看看fileCode +7 wwncly 2026-08-10 13/650 2026-08-11 19:36 by 冰心玉壶晴
[基金申请] 为什么网上很多人说本周 12号出结果 +6 瞬息宇宙 2026-08-10 7/350 2026-08-11 19:25 by Tide man
[硕博家园] 读博的好处 +3 lnee 2026-08-11 3/150 2026-08-11 18:10 by 希望我好好的
[基金申请] 什么时候出结果,有咨询渠道??? +3 Tide man 2026-08-11 3/150 2026-08-11 17:54 by kudofaye
[基金申请] 确定了,国自然21号放榜 +6 布布和一二 2026-08-10 7/350 2026-08-10 19:15 by 2000zf36392
[基金申请] 国自然结果 +4 Vierhys 2026-08-10 8/400 2026-08-10 15:06 by Vierhys
[基金申请] 据悉今年马上要出结果了 +7 瞬息宇宙 2026-08-10 8/400 2026-08-10 12:42 by Vivilian
[基金申请] 这样的filecode谁见过 +11 布布和一二 2026-08-08 22/1100 2026-08-10 11:10 by wmfsnow
[基金申请] 面上项目filecode邪修 +5 西山十月 2026-08-09 7/350 2026-08-10 07:32 by 仁砚薪传
[基金申请] fileCode有新解读? +10 Tide man 2026-08-08 18/900 2026-08-09 12:55 by 仁砚薪传
[基金申请] 关于filecode +4 布布和一二 2026-08-07 7/350 2026-08-07 22:55 by zhanghaozhu
[基金申请] filecode变化情况 +6 布布和一二 2026-08-07 22/1100 2026-08-07 14:45 by 且听虎啸
信息提示
请填处理意见