This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #include<iostream> | |
| using namespace std; | |
| // Neu n la so nguyen to thi tra ve True, nguoc lai False | |
| bool Kiem_Tra_So_Nguyen_To(int n) | |
| { | |
| if(n < 2) | |
| { | |
| return false; | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #include<iostream> | |
| using namespace std; | |
| // ham chuc nang Hoan Vi 2 so a va b | |
| void Hoan_Vi(int &a, int &b) | |
| { | |
| int temp = a; | |
| a = b; | |
| b = temp; | |
| // cout << "\n Gia tri cua a trong ham Hoan Vi: " << a; | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #include<iostream> | |
| using namespace std; | |
| int Tinh_Giai_Thua(int n) | |
| { | |
| int gt = 1; | |
| for(int i = 2; i <= n; i++) | |
| { | |
| gt *= i; | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #include<iostream> | |
| using namespace std; | |
| // Nhap ngay sinh cho biet cung hoang dao la cung j? | |
| void Nhap_Thang(int &thang) | |
| { | |
| do | |
| { | |
| cout << "\nNhap thang: "; | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #include<iostream> | |
| using namespace std; | |
| // Nhap ngay sinh cho biet cung hoang dao la cung j? | |
| void Nhap_Ngay(int &ngay) | |
| { | |
| do | |
| { | |
| cout << "\nNhap ngay: "; | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #include<iostream> | |
| using namespace std; | |
| int main() | |
| { | |
| int h = 3; | |
| // Cach 1: dung FOR | |
| // for(int i = 1; i <= h; i++) | |
| // { | |
| // cout << endl; | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #include<iostream> | |
| using namespace std; | |
| // Viet chuong trinh nhap vao so nguyen n (n > 0). Tinh tong cac so nguyen tu 1 den n. | |
| int main() | |
| { | |
| int n; | |
| do | |
| { | |
| cout << "\nNhap so nguyen n: "; | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #include<iostream> | |
| using namespace std; | |
| int main() | |
| { | |
| int n; | |
| do | |
| { | |
| cout << "\nNhap gia tri n: "; | |
| cin >> n; | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #include<iostream> | |
| using namespace std; | |
| int main() | |
| { | |
| int i = 1; | |
| int n; | |
| cout << "\nNhap so nguyen n: "; | |
| cin >> n; | |
| while (i <= n) | 
NewerOlder