수다닷컴

  • 해외여행
    • 괌
    • 태국
    • 유럽
    • 일본
    • 필리핀
    • 미국
    • 중국
    • 기타여행
    • 싱가폴
  • 건강
    • 다이어트
    • 당뇨
    • 헬스
    • 건강음식
    • 건강기타
  • 컴퓨터
    • 프로그램 개발일반
    • C언어
    • 비주얼베이직
  • 결혼생활
    • 출산/육아
    • 결혼준비
    • 엄마이야기방
  • 일상생활
    • 면접
    • 취업
    • 진로선택
  • 교육
    • 교육일반
    • 아이교육
    • 토익
    • 해외연수
    • 영어
  • 취미생활
    • 음악
    • 자전거
    • 수영
    • 바이크
    • 축구
  • 기타
    • 강아지
    • 제주도여행
    • 국내여행
    • 기타일상
    • 애플
    • 휴대폰관련
  • 프로그램 개발일반
  • C언어
  • 비주얼베이직

-1.#IND00 관련 질문

초코우유

2023.04.01

질문 제목 : -1.#ind00 관련 질문코딩시 -1.#ind00가 뜹니다.질문 내용 :안녕하세요.2개의 변의 길이와 그 끼인각을 입력시키고 나머지 각들과 변의 길이를 cos법칙을 이용하여 구하는 코딩을 하던중에2개의 각이 acos()으로 계산되게 되엇는데 값이 -1.#ind00이 뜹니다.도와주세요 ㅠㅠ#includestdio.h
#includemath.hfloat l1, l2, a1;
double a2, a3;//gather the length of two sides of a triangle as well as the angle between them.
float inputs();//output the third length
float thirdside(float l1, float l2, float a1);//output the other two angles
double otherangle2(float l1, float l2, float l3);
double otherangle3(float l1, float l2, float l3);//output the type of triangle
void type(float a1, double a2, double a3);main()
{
float l3; //get input data
inputs(); //get the length of third side
l3 = thirdside(l1, l2, a1); //get the other two angles
a2 = otherangle2(l1, l2, l3);
a3 = otherangle3(l1, l2, l3); //get the type of the triangle
type(a1, a2, a3);
}///////////////////////////////////////////////////float inputs()
{
printf(enter the length of two sides and the angle between them.\n);
scanf(%f%f%f, &l1, &l2, &a1);
printf(inputs : l1=%f, l2=%f, a1=%f.\n, l1, l2, a1);
}//////////////////////////////////////////////////////////////////////////float thirdside(float l1, float l2, float a1)
{
float l3;
if(a1 == 90)
{
l3 = sqrt(l1*l1 + l2*l2);
printf(the length of the third side is %f\n, l3);
} else
{
l3 = sqrt(l1*l1 + l2*l2 -2*l1*l2*cos(a1));
printf(the length of the third side is %f\n, l3);
} return l3;
}///////////////////////////////////////////////////////////////////////////double otherangle2(float l1, float l2, float l3)
{
a2 = acos( (l2*l2 + l3*l3 - l1*l1) / 2*l2*l3 );

printf(the other two angle2 is %lf.\n, a2); return a2;
}/////////////////////////////////////////////////////////////////////////// double otherangle3(float l1, float l2, float l3)
{
a3 = acos( (l1*l1 + l3*l3 - l2*l2) / 2*l1*l3 ); printf(the other two angle3 is %lf.\n, a3);

return a3;
}/////////////////////////////////////////////////////////////////////////// void type(float a1, double a2, double a3)
{
if(a1 =if(a1 == 90 || a2 == 90 || a3 == 90)
{
printf(this triangle is right triangle.\n);
} else if(a1 90 && a2 90 && a3 90)
{
printf(this triangle is acute triangle.\n);
} else
{
printf(this triangle is obtuse triangle.\n);
}
}감사합니다!

신청하기





COMMENT

댓글을 입력해주세요. 비속어와 욕설은 삼가해주세요.

번호 제 목 글쓴이 날짜
2695766 달팽이 배열 어디서 틀렸는지 모르겠습니다ㅠㅠ 연분홍 2025-05-23
2695738 fopen과fclose질문~~ (5) 희선 2025-05-23
2695707 3의 배수 나타내기. (2) 수리 2025-05-23
2695626 피보나치수열 과제 때문에 질문 드립니다. (6) 옆집언니 2025-05-22
2695595 포인트공부중입니다 int형에서 4=1 인가요? (3) 족장 2025-05-22
2695567 드라이브 고유번호를 가져오는 함수 (2) 초코맛사탕 2025-05-21
2695533 음수의 산술변환! 질문이요 ㅠㅠ... (4) 꽃여름 2025-05-21
2695506 구조체 배열 이용 도서목록 출력 프로그램 (1) 가을귀 2025-05-21
2695450 c언어 함수 질문이요.... 이슬비 2025-05-20
2695403 VirtualAlloc함수 및 메모리 질문 크리에이터 2025-05-20
2695355 c언어 for함수 미쿡 2025-05-19
2695327 안녕하세요 제가 이번에 좀 큰 프로그램을.. 악당 2025-05-19
2695295 mutex동기화의 thread기반 채팅 서버소스 질문입니다 그루터기 2025-05-19
2695270 질문이요..swap 관한겁니다..ㅠㅠ (3) 콩알녀 2025-05-19
2695244 노땅초보궁금한게 하나 있는데요..반복문(while문)초보자질문 (6) 큰꽃늘 2025-05-18
2695166 do while 문 어떤것이잘못된건지 모르겠어요 (2) 아이폰 2025-05-18
2695122 구조체에 대해 물어보고 싶은게 있습니다 ^^^.. (7) 수련 2025-05-17
2695091 txt 파일 입출력 후 2차 배열에 저장하기입니다. (3) 헛장사 2025-05-17
2695063 수도요금 프로그램좀 짜주세요. 시내 2025-05-17
2695033 답변좀요ㅠㅠ (1) 비사벌 2025-05-16
<<  이전  1 2 3 4 5 6 7 8 9 10  다음  >>

수다닷컴 | 여러분과 함께하는 수다토크 커뮤니티 수다닷컴에 오신것을 환영합니다.
사업자등록번호 : 117-07-92748 상호 : 진달래여행사 대표자 : 명현재 서울시 강서구 방화동 890번지 푸르지오 107동 306호
copyright 2011 게시글 삭제 및 기타 문의 : clairacademy@naver.com