#include <stdio.h>
int main() {
/*
==========================================
C언어 프로젝트 테스트
==========================================
[작성 방법]
1. 배부된 시험지의 문제를 읽고 코드를 작성하세요.
2. 필요한 변수는 직접 선언하세요.
3. 입력, 계산, 조건 판단, 출력까지
직접 작성하세요.
4. 문제에서 요구한 조건문을 사용하세요.
5. 코드를 완성한 후 여러 값을 입력하여
정상적으로 실행되는지 확인하세요.
※ 반복문은 사용하지 않습니다.
*/
// ==========================================
// [문제 1]
// 아래에 코드를 작성하세요.
// ==========================================
int user;
int cost;
scanf("%d %d", &user, &cost);
if(user==1){
if(cost>=10000){
cost-=2000;
printf("2000\n");
printf("%d", cost);
}
else if(cost<10000){
cost-=1000;
printf("1000\n");
printf("%d", cost);
}
else{
printf("%d", cost);
}
}
else if(user==0){
printf("%d", cost);
}
else{
printf("?");
}
printf("\n\n");
// ------------------------------------------
// ==========================================
// [문제 2]
// 아래에 코드를 작성하세요.
// ==========================================
int hp;
int attack;
scanf("%d %d", &hp, &attack);
if(hp>=80 && attack>=80){
printf("최강 상태");
}
else if(hp>=50){
if(attack<30){
printf("공격력 부족");
}
}
else if(hp>=50){
printf("정상 상태");
}
else if(hp>=30){
printf("주의 상태");
}
else{
printf("위험 상태");
}
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: