#include <iostream>
#include <windows.h>
using namespace std; // std::cout -> cout
void main() {
bool b = true;
char ch = 'A';
int num = 10, num2;
double db = 10.123456;
cout << "Hello World!" << endl;
//cout = console output, endl = end line
cout << "num : " << num << "입니다." << endl;
cout << "b : " << b << endl;
cout << "ch : " << ch << endl;
cout << fixed; // 소수점 자리만 인식해라
cout.precision(6); // 앞에서 몇 자리 숫자까지 표시할것인가
cout << "db : " << db << endl;
cin >> num >> num2;
cout << "입력하신 숫자 : " << num << num2;
system("pause");
}*/
//국수영 점수 입력받아 총합, 평균(2째짜리 숫자까지)의 점수 출력
/*
#include <iostream>
#include <windows.h>
using namespace std;
void main(){
int korean, math, english, sum =0;
double average = 0;
cout << "국어, 수학, 영어 점수를 입력해 주세요." << endl;
cin >> korean >> math >> english;
sum = korean + math + english;
average = sum / 3;
cout << "점수들의 총합은 " << sum << "입니다. " << endl;
cout << fixed;
cout.precision(2);
cout << "점수들의 평균은" << average << "입니다." << endl;
system("pause");
}*/
#include <iostream>
#include <windows.h>
using namespace std;
void main() {
int x, y, z;
cout << "현재 잔금을 입력해 주세요. " << endl;
cin >> x;
cout << "구매하실 물건의 가격은? " << endl;
cin >> y;
z = x - y;
cout << "구매후 남은 잔금은 " << z << endl;
int a, b;
cout << "구매하실 물건의 가격은?" << endl;
cin >> a;
b = z - a;
cout << "구매후 남은 잔금은 " << b << "입니다." << endl;
system("pause");
}
댓글 없음:
댓글 쓰기