daily pastebin goal
65%
SHARE
TWEET

Untitled

a guest Mar 13th, 2018 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<bits/stdc++.h>
  2. #define maxn 10000
  3. #define oo 1000000007
  4. #define ll long long
  5. #define ld long double
  6. #define FOR(i,a,b) for(int i=(a), ii=(b); i<=ii; i++)
  7. #define FORD(i,b,a) for(int i=(b), ii=(a); i>=ii; i--)
  8. class DON_HANG{
  9. private:
  10.     char* TENHANG;
  11.     ll DONGIA;
  12.     ll SOLUONG;
  13.     ll THANHTIEN;
  14. public:
  15.     DON_HANG(){
  16.         DONGIA=0;
  17.         SOLUONG=0;
  18.         THANHTIEN=0;
  19.     }
  20.     DON_HANG(char* tenhang, ll dongia=0, ll soluong=0){
  21.         setTENHANG(tenhang);
  22.         setDONGIA(dongia);
  23.         setSOLUONG(soluong);
  24.     }
  25.     void setTENHANG(char* tenhang){
  26.         ll len = strlen(tenhang);
  27.         TENHANG = new char[len];
  28.         TENHANG = strcpy(TENHANG, tenhang);
  29.     }
  30.     void setSOLUONG(ll soluong){
  31.         SOLUONG = soluong;
  32.         setTHANHTIEN();
  33.     }
  34.     void setDONGIA(ll dongia){
  35.         DONGIA = dongia;
  36.         setTHANHTIEN();
  37.     }
  38.     void setTHANHTIEN(){
  39.         THANHTIEN = DONGIA * SOLUONG;
  40.     }
  41.     char* getTENHANG(){
  42.         return TENHANG;
  43.     }
  44.     ll getDONGIA(){
  45.         return DONGIA;
  46.     }
  47.     ll getSOLUONG(){
  48.         return SOLUONG;
  49.     }
  50.     ll getTHANHTIEN(){
  51.         return THANHTIEN;
  52.     }
  53. };
  54.  
  55. int main(){
  56.     DON_HANG* DH= new DON_HANG[50];
  57. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top