-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a9ca2da
commit 31187f7
Showing
5 changed files
with
89 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#include <iostream> | ||
|
||
using namespace std; | ||
|
||
int main(){ | ||
int a,b; | ||
cout << "Nhap so nguyen a: "; | ||
cin >> a; | ||
cout << "Nhap so nguyen b: "; | ||
cin >> b; | ||
int tong=a+b; | ||
int hieu=a-b; | ||
int tich=a*b; | ||
int thuong=a/b; | ||
int du=a%b; | ||
cout << "Tong cua 2 so nguyen " << a << " va " << b << " la: " << tong << "\n"; | ||
cout << "Hieu cua 2 so nguyen " << a << " va " << b << " la: " << hieu << "\n"; | ||
cout << "Tich cua 2 so nguyen " << a << " va " << b << " la: " << tich << "\n"; | ||
cout << "Thuong cua phep chia 2 so nguyen " << a << " va " << b << " la: " << thuong << "\n"; | ||
cout << "Du cua phep chia 2 so nguyen " << a << " va " << b << " la: " << du << "\n"; | ||
return 0; | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#include <iostream> | ||
|
||
using namespace std; | ||
|
||
int main(){ | ||
int n; | ||
cout << "Nhap mot so nguyen co it hon 5 chu so: "; | ||
cin >> n; | ||
int N = n/1000; | ||
int T = (n%1000)/100; | ||
int C = (n%100)/10; | ||
int D = n%10; | ||
cout << N << " nghin " << T << " tram " << C << " chuc " << D << " don vi.\n"; | ||
return 0; | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#include <iostream> | ||
#include <math.h> | ||
|
||
using namespace std; | ||
|
||
int main(){ | ||
int x; | ||
cout << "Nhap vao so nguyen x: "; | ||
cin >> x; | ||
float f = (x*x+exp(abs(x))+sin(x)*sin(x))/pow(x*x+1,1.0/5); | ||
cout << "f(x) = " << f << "\n"; | ||
return 0; | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#include <iostream> | ||
#include <math.h> | ||
|
||
using namespace std; | ||
|
||
int main(){ | ||
int x1,x2,y1,y2; | ||
cout << "Nhap toa do diem A: "; | ||
cin >> x1 >> y1; | ||
cout << "Nhap toa do diem B: "; | ||
cin >> x2 >> y2; | ||
float D = sqrt(pow(x2-x1,2)+pow(y2-y1,2)); | ||
float M = abs(x2-x1)+abs(y2-y1); | ||
float C = 1-((x1*x2+y1*y2)/(sqrt(x1*x1+y1*y1)*sqrt(x2*x2+y2*y2))); | ||
cout << "Giua A(" << x1 << "," << y1 << ") va B(" << x2 << "," << y2 << "):\n"; | ||
cout << "- Khoang cach Euclidean la: " << D << "\n"; | ||
cout << "- Khoang cach Manhattan la: " << M << "\n"; | ||
cout << "- Khoang cach Cosin la: " << C << "\n"; | ||
return 0; | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#include <iostream> | ||
#include <math.h> | ||
|
||
using namespace std; | ||
|
||
int main(){ | ||
int x1,x2,x3,y1,y2,y3; | ||
cout << "Nhap toa do diem A: "; | ||
cin >> x1 >> y1; | ||
cout << "Nhap toa do diem B: "; | ||
cin >> x2 >> y2; | ||
cout << "Nhap toa do diem C: "; | ||
cin >> x3 >> y3; | ||
float x = (x1+x2+x3)/3; | ||
float y = (y1+y2+y3)/3; | ||
float inter = sqrt(pow(x1-x,2)+pow(y1-y,2))+sqrt(pow(x2-x,2)+pow(y2-y,2))+sqrt(pow(x3-x,2)+pow(y3-y,2)); | ||
cout << "Inter = " << inter << "\n"; | ||
return 0; | ||
} |