본문 바로가기

분류 전체보기93

Stack push pop peek -------------------------------- Process exited after 0.0512 seconds with return value 12 계속하려면 아무 키나 누르십시오 . . . Stack is Empty!! Stack is Empty!! 입력된 스택 99 입력된 스택 99 입력된 스택 88 입력된 스택 77 입력된 스택 55 Stack is Full! 출력 스택 55 출력 스택 77 출력 스택 88 출력 스택 99 출력 스택 99 Stack is Empty!! 출력 스택 0 -------------------------------- Process exited after 0.0512 seconds with return value 12 계속하려면 아무 키나 누르십시오 . . . #.. 2019. 4. 9.
함수 사용 #include int fac(int); int main() { int i; for(i=1; i 2019. 4. 8.
C조 문제 우리가 푼 것 #include int main() { int year; printf("년도를 입력하세요:"); scanf("%d", &year); if(year%4==0) { if(year%100==0) { if(year%400==0) printf("%d년은 윤년입니다.",year); else printf("%d년은 윤년이 아닙니다.",year); } else printf("%d년은 윤년입니다.",year); } else printf("%d년은 윤년이 아닙니다.",year); return 0; } 원코드 #include int main() { int y; printf("윤년이라는 것을 알고 싶은 연도를 입력하세요:"); scanf("%d", &y); if(0==y%400) { printf("%d년은 윤년.. 2019. 4. 7.
A조 문제 우리가 푼 것 #include #include int main() { int a,b,c; int D; printf("ax^2 + bx + c = 0 해를 구한다.\n"); printf("계수 a,b,c의 값을 입력하세요."); scanf("%d %d %d", &a, &b, &c); D=b*b-(4*a*c); printf("D=%d\n", D); if(D>0) { int x, y; x=(-b+sqrt(b*b-4*a*c))/(2*a); y=(-b-sqrt(b*b-4*a*c))/(2*a); printf("두 개의 근 %d, %d", x, y); } if(D=0) { int z; z=(-b+sqrt(b*b-4*a*c))/(2*a); printf("한 개의 근 %d", z); } if(D 2019. 4. 7.
B조 문제 우리 조가 푼 것 #include int main() { int i; int num[5]; int sum=0; int max=0; int min=999; printf("5명의 학생의 키(cm)를 입력 하세요:"); for(i=0; i 2019. 4. 7.