You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// '크리스마스 때까지 여자친구가 없으면'// 친구가 '소개팅을 주선해준다'고 했습니다.// 구라이므로 거르면 됩니다.#include<stdio.h>#include<time.h>// 출처: https://korbillgates.tistory.com/100intmain(void){
time_tt=time(NULL);
structtmtm=*localtime(&t);
// 현재 날짜에 대한 정보를 int로 저장intthis_year=tm.tm_year+1900;
intthis_month=tm.tm_mon+1;
intthis_date=tm.tm_mday;
// 친구가 장난질한 크리스마스에 대한 정보를 int로 저장intxmas_year=this_year;
intxmas_month=12;
intxmax_date=25;
// 여자친구를 사귀고 있는지 여부를 저장// 이는 있을 수 없는 일이야intgirl_friend1;
// chris-mas가 다가왔는지 두근두근거리는 마음으로 확인해 봅시다.if (this_year==xmax_year) {
// 친구놈이 연도로 장난질했을 수도 있기 때문에 검사if (this_month==xmas_month) {
// 12월인지 체크if (this_date >= 25) {
// 25일이 지났는지도 체크..!// 친구놈에게 소개시켜달라고 재촉printf("약속의 날이다. 소개팅 주선해줘라.\n");
if (girl_friend) {
// 여자친구가 있어도 뻔뻔하게 주장해봅시다. 그러면 친구는return"여친있는 놈이 --!!";
}
else {
// 이 놈은 애초에 여소해줄 마음이 없었습니다.// 뭐라 하는지 들어봅시다.return"그걸 믿었냐? ㅋ";
}
}
}
}
// 아직 크리스마스가 오지 않았다면 당신은 계속해서 농락당하고 있겠죠.return"친구야 크리스마스까지 조금만 참으렴 ㅠㅠ"
}
번외
5장 도전 실전 예제, 계산기 프로그램
키보드로 수식을 입력하면 계산 결과를 출력하는 프로그램을 작성하세요. 정수 사칙연산만 입력합니다.