#include <stdio.h>
#include <iostream.h> // 비주얼 스튜디오 6.0에서 가능
#include <iomanip.h>
/*
#include <iostream> // 비주얼 스튜디오 2005이상 (6.0도 가능)
using namespace std;
*/
void main ( )
{
}
/*
void plus(int a, int b, int c = 50) // c를 디폴트 매개변수로 생성
{
cout << "합 = " << a+b+c << endl;
}
void main ( )
{
plus(10, 20); // 80
plus(10, 20, 30); // 60
}
*/
/*
void main ( )
{
short a = 16706;
char *cp = (char*)&a;
cout << "*cp = " << *cp << endl; // B
cout << "*(cp+1) = " << *(cp+1) << endl; // A
}
*/
/*
void main ( )
{
int a = 65;
cout << "a = " << a << endl; // 65
cout << "a = " << char (a) << endl; // A
}
*/
/*
int a = 10; // 전역변수
void main ( )
{
int *temp = &a;
cout << "a = " << a << endl; // 10
int a = 20; // 지역변수
cout << "a = " << a << endl; // 20
cout << *temp << endl; // 10
cout << "::a = " << ::a << endl; // 10
}
*/
/* 수정 요망
void main ( )
{
int a, b;
cout << "국어 점수를 입력하세요 : ";
cin >> a;
cout << "영어 점수를 입력하세요 : ";
cin >> b;
cout << "당신의 평균 점수는 " << << (a+b)/2 << " 입니다." << endl;
}
*/
/*
void main ( )
{
int a, b;
cout << "밑변의 길이를 입력하세요 : ";
cin >> a;
cout << "높이의 길이를 입력하세요 : ";
cin >> b;
cout << "밑변이 " << a <<"이고 높이가 " << b << "인 사각형의 넓이는 " << a*b << "둘레는 " << (a+b)*2 << "입니다." << endl;
}
*/
/*
void main ( )
{
cout << 3.14 << endl; // cout << 3.14 << "\n";
cout << 12 << endl;
cout << oct << 12 << endl; // oct는 정수를 8진수로 출력해준다.
cout << hex << 12 << endl; // hex는 정수를 16진수로 출력해준다.
cout << dec << 12 << endl; // dec는 정수를 10진수로 출력해준다.
cout << "###" << 1.5 << "###" << endl;
cout << "###" << setw(5) << 1.5 << "###" << endl;
cout << "###" << setw(5) << setfill('z') << 1.5 << "###" << endl;
cout << "###" << setw(5) << setfill(' ') << 1.5 << "###" << endl;
cout << setiosflags(ios::left); // 출력시 확보된 공간내 왼쪽 정렬
cout << "###" << setw(5) << 1.5 << "###" << endl;
cout << resetiosflags(ios::left); // 지정된 ios::left를 해제
cout << setiosflags(ios::fixed) << setprecision(3) << 1.5 << endl;
// 소수점 이하 자리수를 지정해서 출력하는 방법
}
*/
/*
void main ( )
{
int a;
char b;
double c;
char name[11];
cin >> a; // scanf("%d", &a);
cout << "a = " << a << "\n";
cin >> b; // fflush(stdin); scanf("%c", &b);
cout << "b = " << b << "\n";
cin >> c; // scanf("%lf", &c);
cout << "c = " << c << "\n";
cin >> name; // sncaf("%s", name);
cout << "name = " << name << "\n";
}
*/
/*
void main ( )
{
int a=7;
char b = 'R';
double c = 12.5;
cout << "안녕하세요.\n\t\b" ; // printf("안녕하세요.");
cout << 10; // printf("%d", 10);
cout << 3.14; // printf("%f", 3.14);
cout << 'Z'; // printf("%c", 'Z');
cout << a; // printf("%d", a);
cout << b; // printf("%d", b);
cout << c; // printf("%d", c);
cout << "a = " << a << "입니다.\n"; // printf("a = %d입니다.\n", a);
cout << a << c << "\n"; // printf("%d%f\n", a, c);
}
*/
'매니저 > C++' 카테고리의 다른 글
C++ 2011.09.25 (미검사) (0) | 2011.10.13 |
---|---|
C++ 2011.09.24 (미검사) (0) | 2011.10.13 |
C++ 2011.09.18 (미검사) (0) | 2011.10.13 |
C++ 2011.09.17 (미검사) (0) | 2011.10.13 |
C++ 2011.09.04 (미검사) (0) | 2011.10.13 |