Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int check_same(int *lotto_nums,int *my_nums);
- int main(void)
- {
- int lotto_nums[6] = {4, 10, 25, 30, 41, 45};
- int my_nums[6] = {1, 4, 7, 22, 41, 43};
- check_same(lotto_nums, my_nums);
- return 0;
- }
- int check_same(int *lotto_nums,int *my_nums)
- {
- int cnt=0 , cknum=0;
- while(cnt<6)
- {
- for(int i=0;i<6;i++)
- {
- if(lotto_nums[cnt]==my_nums[i]) cknum++;
- }
- cnt++;
- }
- if (cknum == 0)printf("일치하지 않는 숫자가 없어요,\n");
- else printf("일치하는 번호의 개수 : %d\n", cknum);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement