Ngôn ngữ lập trình c&c++ ( Phạm Hồng Thái) P32
... operator<< (ostream& os, DT d); istream& operator>> (istream& is, DT &d); DT operator-(const DT& d); DT operator+(DT d1, DT d2); DT operator-(DT d1, DT d2); DT operator*(DT ... } DT operator-(DT d1, DT d2) { return (d1 + (- d2)); } DT operator*(DT d1 , DT d2) { DT d; int k, i, j; k = d.n = d1.n + d2.n ; for (i=0;i<=k;++i) d.a[i] = 0; for...
Ngày tải lên: 28/10/2013, 14:15
... for (int j = 1; j< = a.n; ++j) cout << a.a[i][j] << " "; } } void main() { MT a; VT x, y; clrscr(); a.nhapsl(); x.nhapsl(); y = tich(a, x); clrscr(); cout ... operator<< (ostream& os, PS p); istream& operator>> (istream& is,PS &p); int uscln(int x, int y); PS rutgon(PS p); PS operator+(PS p1, PS p2); PS operator-(PS p1,...
Ngày tải lên: 24/10/2013, 07:15
... printf() và scanf() #include <conio.h> // để sử dụng các hàm clrscr() và getch() void main() { clrscr(); // xoá màn hình printf("CHI TIÊU\n=======\n") ; printf("Sách ... ; printf("Thức ăn %20.2f\n" , 2453.6) ; printf(“Quần áo lạnh %15.2f\n" , 3200.0) ; getch(); // tạm dừng ( ể xem kết quả) return ; // kết thúc thực hiện hàm main() }...
Ngày tải lên: 07/11/2013, 07:15