Yam Code
Sign up
Login
New paste
Home
Trending
Archive
English
English
Tiếng Việt
भारत
Sign up
Login
New Paste
Browse
#include <iostream> #include <iomanip.h> #include <conio.h> using namespace std; struct DATE { int ng,th,nam; friend bool operator==(DATE &a, DATE &nlx) { return(a.ng==nlx.ng && a.th==nlx.th && a.nam==nlx.nam); } }; class PHIEU { protected: char sp[10]; DATE nl; float tkn,tkc; public: void Nhap() { fflush(stdin); cout<<"Nhap so phieu: ";cin.getline(sp,10); cout<<"Nhap ngay lap: ";cin>>nl.ng>>nl.th>>nl.nam; cout<<"Nhap tai khoan no: ";cin>>tkn; cout<<"Nhap tai khoan co: ";cin>>tkc; } void Xuat() { cout<<setiosflags(ios::left)<<setw(10)<<sp; if(nl.ng>9)cout<<nl.ng<<"-";else cout<<"0"<<nl.ng<<"-"; if(nl.th>9)cout<<nl.th<<"-";else cout<<"0"<<nl.th<<"-"; cout<<setiosflags(ios::left)<<setw(8)<<nl.nam; cout<<setiosflags(ios::left)<<setw(20)<<tkn; cout<<setiosflags(ios::left)<<setw(20)<<tkc; } }; class PHIEUXUAT: public PHIEU { private: char ht[30]; char ld[50]; char xtk[50]; float st; public: void Nhap() { PHIEU::Nhap(); fflush(stdin); cout<<"Nhap ho ten nguoi nhan: ";cin.getline(ht,30); fflush(stdin); cout<<"Nhap ly do xuat: ";cin.getline(ld,50); fflush(stdin); cout<<"Xuat tai kho: ";cin.getline(xtk,50); cout<<"Nhap so tien: ";cin>>st; } void Xuat() { PHIEU::Xuat(); cout<<setiosflags(ios::left)<<setw(30)<<ht; cout<<setiosflags(ios::left)<<setw(30)<<ld; cout<<setiosflags(ios::left)<<setw(20)<<xtk; cout<<st; } friend bool operator==(PHIEUXUAT &a, DATE nlx) { return(a.nl==nlx); } }; class PHIEUTHU: public PHIEU { private: char ht[30]; char dc[50]; char ld[50]; float st; public: void Nhap() { PHIEU::Nhap(); fflush(stdin); cout<<"Nhap ho ten nguoi nop: ";cin.getline(ht,30); fflush(stdin); cout<<"Nhap dia chi: ";cin.getline(dc,50); fflush(stdin); cout<<"Xuat ly do: ";cin.getline(ld,50); cout<<"Nhap so tien: ";cin>>st; } void Xuat() { PHIEU::Xuat(); cout<<setiosflags(ios::left)<<setw(30)<<ht; cout<<setiosflags(ios::left)<<setw(30)<<dc; cout<<setiosflags(ios::left)<<setw(20)<<ld; cout<<st; } friend bool operator==(PHIEUTHU &a, const float b) { return(a.st==b); } }; int main() { PHIEUXUAT *a; PHIEUTHU *b; int i,n; //================================================ //Phieu xuat cout<<"Nhap so luong phieu xuat: ";cin>>n; a=new PHIEUXUAT[n]; cout<<"\n\n\tNHAP THONG TIN PHIEU XUAT"; cout<<"\n------------------------------------------\n"; for(i=0;i<n;i++) { cout<<"\n\n\tNhap thong tin phieu xuat thu "<<i+1<<endl<<endl; a[i].Nhap(); } cout<<"\n------------------------------------------\n\n\n"; DATE nlxx={22,1,2021}; cout<<"\t\t\t\t\tDANH SACH THONG TIN PHIEU XUAT VAT TU TRONG NGAY 22-1-2021"<<"\n\n\n"; cout<<"\n--------------------------------------------------------------------------------------------------------------------------------------------------------\n"; cout<<setiosflags(ios::left)<<setw(10)<<"So phieu"; cout<<setiosflags(ios::left)<<setw(14)<<"Ngay lap"; cout<<setiosflags(ios::left)<<setw(20)<<"Tai khoan no"; cout<<setiosflags(ios::left)<<setw(20)<<"Tai khoan co"; cout<<setiosflags(ios::left)<<setw(30)<<"Ho ten nguoi Nhan"; cout<<setiosflags(ios::left)<<setw(30)<<"Ly do xuat kho"; cout<<setiosflags(ios::left)<<setw(20)<<"Xuat tai kho"; cout<<setiosflags(ios::left)<<setw(20)<<"So tien"; cout<<"\n--------------------------------------------------------------------------------------------------------------------------------------------------------\n"; for(i=0;i<n;i++) { if(a[i]==nlxx) { a[i].Xuat(); cout<<endl; } } cout<<"\n--------------------------------------------------------------------------------------------------------------------------------------------------------\n\n\n"; //================================================ //Phieu thu cout<<"Nhap so luong phieu xuat: ";cin>>n; b=new PHIEUTHU[n]; cout<<"\n\n\tNHAP THONG TIN PHIEU THU"; cout<<"\n------------------------------------------\n"; for(i=0;i<n;i++) { cout<<"\n\n\tNhap thong tin phieu thu thu "<<i+1<<endl<<endl; b[i].Nhap(); } cout<<"\n------------------------------------------\n\n\n"; cout<<"\t\t\t\t\tDANH SACH THONG TIN PHIEU THU CO SO TIEN LON HON 5 TR"<<"\n\n\n"; cout<<"\n--------------------------------------------------------------------------------------------------------------------------------------------------------\n"; cout<<setiosflags(ios::left)<<setw(10)<<"So phieu"; cout<<setiosflags(ios::left)<<setw(14)<<"Ngay lap"; cout<<setiosflags(ios::left)<<setw(20)<<"Tai khoan no"; cout<<setiosflags(ios::left)<<setw(20)<<"Tai khoan co"; cout<<setiosflags(ios::left)<<setw(30)<<"Ho ten nguoi Nhan"; cout<<setiosflags(ios::left)<<setw(30)<<"Dia chi"; cout<<setiosflags(ios::left)<<setw(20)<<"Ly do"; cout<<setiosflags(ios::left)<<setw(20)<<"So tien"; cout<<"\n--------------------------------------------------------------------------------------------------------------------------------------------------------\n"; for(i=0;i<n;i++) { if(b[i]==5000000) { b[i].Xuat(); cout<<endl; } } cout<<"\n--------------------------------------------------------------------------------------------------------------------------------------------------------\n\n\n"; return 0; }
Paste Settings
Paste Title :
[Optional]
Paste Folder :
[Optional]
Select
Syntax Highlighting :
[Optional]
Select
Markup
CSS
JavaScript
Bash
C
C#
C++
Java
JSON
Lua
Plaintext
C-like
ABAP
ActionScript
Ada
Apache Configuration
APL
AppleScript
Arduino
ARFF
AsciiDoc
6502 Assembly
ASP.NET (C#)
AutoHotKey
AutoIt
Basic
Batch
Bison
Brainfuck
Bro
CoffeeScript
Clojure
Crystal
Content-Security-Policy
CSS Extras
D
Dart
Diff
Django/Jinja2
Docker
Eiffel
Elixir
Elm
ERB
Erlang
F#
Flow
Fortran
GEDCOM
Gherkin
Git
GLSL
GameMaker Language
Go
GraphQL
Groovy
Haml
Handlebars
Haskell
Haxe
HTTP
HTTP Public-Key-Pins
HTTP Strict-Transport-Security
IchigoJam
Icon
Inform 7
INI
IO
J
Jolie
Julia
Keyman
Kotlin
LaTeX
Less
Liquid
Lisp
LiveScript
LOLCODE
Makefile
Markdown
Markup templating
MATLAB
MEL
Mizar
Monkey
N4JS
NASM
nginx
Nim
Nix
NSIS
Objective-C
OCaml
OpenCL
Oz
PARI/GP
Parser
Pascal
Perl
PHP
PHP Extras
PL/SQL
PowerShell
Processing
Prolog
.properties
Protocol Buffers
Pug
Puppet
Pure
Python
Q (kdb+ database)
Qore
R
React JSX
React TSX
Ren'py
Reason
reST (reStructuredText)
Rip
Roboconf
Ruby
Rust
SAS
Sass (Sass)
Sass (Scss)
Scala
Scheme
Smalltalk
Smarty
SQL
Soy (Closure Template)
Stylus
Swift
TAP
Tcl
Textile
Template Toolkit 2
Twig
TypeScript
VB.Net
Velocity
Verilog
VHDL
vim
Visual Basic
WebAssembly
Wiki markup
Xeora
Xojo (REALbasic)
XQuery
YAML
HTML
Paste Expiration :
[Optional]
Never
Self Destroy
10 Minutes
1 Hour
1 Day
1 Week
2 Weeks
1 Month
6 Months
1 Year
Paste Status :
[Optional]
Public
Unlisted
Private (members only)
Password :
[Optional]
Description:
[Optional]
Tags:
[Optional]
Encrypt Paste
(
?
)
Create New Paste
You are currently not logged in, this means you can not edit or delete anything you paste.
Sign Up
or
Login
Site Languages
×
English
Tiếng Việt
भारत