C언어 ㅇ_ㅇ
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
/*
class Rectangle{
private : int garo,sero,area;
public : Rectangle(int g,int s)
{
garo=g;
sero=s;
area=garo*sero;
}
int getGaro() { return garo;}
int getSero() { return sero;}
int getArea() { return area;}
};
int main()
{
int garo,sero,area;
cout << "가로 : "<<endl;
cin >> garo;
cout << "세로 : " <<endl;
cin >> sero;
Rectangle rec(garo,sero);
cout << "가로 : " << rec.getGaro()<<"세로 : " <<rec.getSero() <<"넓이: " <<rec.getArea()<<endl;
}
*/
/*
class Rectangle{
private : int garo,sero,area;
public : Rectangle(int g,int s)
{
garo=g;
sero=s;
area=garo*sero;
}
int getGaro() { return garo;}
int getSero() { return sero;}
int getArea() { return area;}
};
int main()
{
int garo,sero,area;
Rectangle rec(garo,sero);
ofstream fout;
fout.open("c:\rec.txt");
fout << "가로 : "<<endl;
cout << "가로 : "<<endl;
cin >> garo;
fout << "세로 : " <<endl;
cout << "세로 : " <<endl;
cin >> sero;
fout << "가로 : " << rec.getGaro()<<"세로 : " <<rec.getSero() <<"넓이: " <<rec.getArea()<<endl;
fout.close();
}
*/
/*
class student
{
private : string name;
int mid,final;
float score;
public : student(string n,int m,int f)
string getName(){ return Name;}
int getMid() { return Mid;}
int getfinal() {return final;}
float getScore() {return Score;}
void calcScore() {float Score= (mid+final)/2);}
};
int maim(){
string name; int mid,final;
student stu(name,mid,final)
cout << "이름 : ";
cin >> name;
cout<<"중간 : ";
cin >> mid;
cout<<"기말 : ";
cin >> final;
cout<<"이름 : " <<stu.getName()<<"중간고사 : "<<stu.getMid()<<"기말고사 : "<<stu.getScore<<endl;
}
*/
class Student
{
private : string name;
int mid,final;
float score;
public :
Student(string n,int m,int f){name=n; mid=m; final=f;}
Student(){name="";mid=0;final=0;}
string getName(){ return Name;}
int getMid() { return Mid;}
int getfinal() {return final;}
float getScore() {return Score;}
void calcScore() {float Score= (mid+final)/2);}
void setStudent(string n,int m,int f) {name=n; mid=m final=f;}
};
int mian(){
string name; int mid,final; float score;
Student std[3];
for(int i=0;i<3<<i++)
{
cout << "이름 : ";
cin >> name;
cout<<"중간 : ";
cin >> mid;
cout<<"기말 : ";
cin >> final;
}
std[i].setStudent(name,mid,final);
std[i].calcScore();
cout<<"이름 : " <<std[i].getName()<<"중간고사 : "<<std[i].getMid()<<"기말고사 : "<<std[i].getfinal<<endl;
}