Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
Tags
- perpect C
- 3판
- 티스토리 커버이미지 변경
- () (+) 차이
- putchar()
- c
- 비트마스크
- 평균
- JavaScript
- 정답
- 3강
- 점프 투 파이썬 #패키지 # 비전공자
- 쉼표필요
- 풀이
- perpectC
- eslint 쉼표필요 오류
- Chapter3
- 원 면적
- 합
- 3장
- 실습예제
- +연산자 의미
- 백엔드 개발자 #로드맵
- 연습문제
- PERPECT
- eslint
- 오류
- getchar()
- 원 둘레
- ㅔㄴ트 안잉
Archives
- Today
- Total
옥수수와 식빵 그리고 코딩
로또, 연결리스트 출력, 연결리스트 마지막 리스트에 노드 붙이기 본문
중복 없는 랜덤 배열 생성할 때
int sran(int seed)//seed는 사용자 입력
{
srand(seed);
int random = 0;
for (int i = 0;i < 7;i++)
{
ran[i] = (rand() % 7) + 1;
for (int j = 0;j < i ;j++)//i-1하면 중복 나옴!!
{
if (ran[i] == ran[j])
{
i--;//중복 발생 시 i번재 난수 재생성
break;
}
}
}
for (int i = 0;i < 7;i++)//출력
{
printf("randNum[%d] : %d\n", i+1, ran[i]);
}
}
for (int j = 0;j < i ;j++)//i-1하면 중복 나옴!!
이 문장을 기억할 것!
*연결리스트 출력

https://tildacoderecorder.tistory.com/96
[자료구조] C언어 연결리스트(Linked list) 생성 / 출력
연결리스트 만들기 "월" "화" "수" "목" "금" 등 요일을 데이터값으로 갖는 연결리스트를 만들어보자. typedef struct node { char data; struct node* next; } ..
tildacoderecorder.tistory.com
연결리스트 마지막 리스트에 노드 붙이기
NODE *temp = *head;
// 마지막 노드를 찾는 루프
while(temp->next != NULL)
{
temp = temp->next;
}
// 마지막 노드일 경우 새로 생성한 노드 연결
temp->next = newNode;
https://ititit1.tistory.com/78
[자료구조] C 연결리스트 마지막 리스트에 노드 붙이기
#include #include typedef struct node{ int data; struct node* next; }NODE; //전달받은 데이터를 저장하는 하나의 노드를 생성하는 함수 NODE* createNode(int data) { NODE *temp = (NODE*)malloc(sizeof(NOD..
ititit1.tistory.com