구조체배열 정렬
이리온
질문 제목 : 질문 요약 :밑에 코드를 사진처럼 어떡게 정렬하나요.........하 미치겟습니다 ㅠㅠㅠㅠ 학교에 아는사람도없고
머리가 돌이라 도저히 모르겠네요...ㅠㅠ 알려주세요
질문 내용 :
#include stdio.h
#include math.h
typedef struct circle{
double x;
double y;
} Circle;
int main()
{
Circle xy[30];
double lad_0 = (0.0 / 180.0) * 3.14;
double lad_30 = (30.0 / 180.0) * 3.14;
double lad_45 = (45.0 / 180.0) * 3.14;
double lad_60 = (60.0 / 180.0) * 3.14;
double lad_90 = (90.0 / 180.0) * 3.14;
xy[0].x = cos(lad_0);
xy[0].y = sin(lad_0);
xy[1].x = cos(lad_30);
xy[1].y = sin(lad_30);
xy[2].x = cos(lad_45);
xy[2].y = sin(lad_45);
xy[3].x = cos(lad_90);
xy[3].y = sin(lad_90);
xy[4].x = -cos(lad_0);
xy[4].y = sin(lad_0);
xy[5].x = -cos(lad_30);
xy[5].y = sin(lad_30);
xy[6].x = -cos(lad_45);
xy[6].y = sin(lad_45);
xy[7].x = -cos(lad_90);
xy[7].y = sin(lad_90);
xy[8].x = -cos(lad_0);
xy[8].y = -sin(lad_0);
xy[9].x = -cos(lad_30);
xy[9].y = -sin(lad_30);
xy[10].x = -cos(lad_45);
xy[10].y = -sin(lad_45);
xy[11].x = -cos(lad_90);
xy[11].y = -sin(lad_90);
xy[12].x = cos(lad_0);
xy[12].y = -sin(lad_0);
xy[13].x = cos(lad_30);
xy[13].y = -sin(lad_30);
xy[14].x = cos(lad_45);
xy[14].y = -sin(lad_45);
xy[15].x = cos(lad_90);
xy[15].y = -sin(lad_90);
printf((%lf %lf)\n, xy[0].x, xy[0].y );
printf((%lf %lf)\n, xy[1].x, xy[1].y );
printf((%lf %lf)\n, xy[2].x, xy[2].y );
printf((%lf %lf)\n, xy[3].x, xy[3].y );
printf((%lf %lf)\n, xy[4].x, xy[4].y );
printf((%lf %lf)\n, xy[5].x, xy[5].y );
printf((%lf %lf)\n, xy[6].x, xy[6].y );
printf((%lf %lf)\n, xy[7].x, xy[7].y );
printf((%lf %lf)\n, xy[8].x, xy[8].y );
printf((%lf %lf)\n, xy[9].x, xy[9].y );
printf((%lf %lf)\n, xy[10].x, xy[10].y );
printf((%lf %lf)\n, xy[11].x, xy[11].y );
printf((%lf %lf)\n, xy[12].x, xy[12].y );
printf((%lf %lf)\n, xy[13].x, xy[13].y );
printf((%lf %lf)\n, xy[14].x, xy[14].y );
printf((%lf %lf)\n, xy[15].x, xy[15].y );
}
번호 | 제 목 | 글쓴이 | 날짜 |
---|---|---|---|
2700562 | 함수포인터에서요 (7) | 소심한여자 | 2025-07-06 |
2700530 | 전처리문 질문입니다. (1) | 아놀드 | 2025-07-05 |
2700510 | c언어를 어케하면 잘할수 있을까요.. | 연연두 | 2025-07-05 |
2700484 | 두 개가 차이가 뭔지 알려주세요...(소수 찾는 프로그램) (2) | 날위해 | 2025-07-05 |
2700426 | 인터넷 창 띄우는 질문이요 (1) | 정훈 | 2025-07-04 |
2700400 | 원넓이를 계산이요 ㅜㅜ | 천칭자리 | 2025-07-04 |
2700368 | if에 관해서 질문이요... | Orange | 2025-07-04 |
2700339 | 이거 결과값이 왜이런건지.. (4) | 그댸와나 | 2025-07-04 |
2700313 | 파일 읽어서 저장하는데 빈파일일 경우 문재가 발생하네요.. (2) | 크나 | 2025-07-03 |
2700287 | 구조체 동적할당 연습을 하는데 오류가 뜹니다...(해결) (3) | 아련나래 | 2025-07-03 |
2700264 | 문자와 숫자 동시에 입력??? | 글고운 | 2025-07-03 |
2700236 | txt파일로만 쓰고 읽게 하려면 어떻게 해야 하나요..?? (8) | 미국녀 | 2025-07-03 |
2700211 | 전위 연산자 (2) | 어른처럼 | 2025-07-02 |
2700183 | C에서 파일이름을 받고, 그 파일의 사이즈를 출력해줘야하는데 내용이 출력이 안되네요 ;ㅅ; | 피스케스 | 2025-07-02 |
2700150 | 꼭좀 도와주세요ㅠㅠㅠ | 호습다 | 2025-07-02 |
2700095 | 연산문제...질문... | 오빤테앵겨 | 2025-07-01 |
2700070 | while문 , 3의배수 출력하는 프로그램좀 짜주세욤. | 횃불 | 2025-07-01 |
2700041 | 초보인데요 ㅎ 배열안에 배열을 집어넣을수 있나요?? | 헛장사 | 2025-07-01 |
2700012 | 배열// (1) | 전갈자리 | 2025-07-01 |
2699895 | 무한루프에 빠집니다.!! 해결좀부탁드려요 (10) | 선아 | 2025-06-30 |