-
Notifications
You must be signed in to change notification settings - Fork 1
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
45e628d
commit 94c2389
Showing
6 changed files
with
140 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,13 @@ | ||
#include <iostream> | ||
|
||
int main() | ||
{ | ||
std::cout << "Ներմուծեք որևէ ամբողջ թիվ. "; | ||
int number = 0; | ||
std::cin >> number; | ||
|
||
if( number % 3 == 0 ) | ||
std::cout << number << "-ը երեքի պատիկ է" << std::endl; | ||
|
||
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> | ||
|
||
int main() | ||
{ | ||
std::cout << "Ներմուծեք որևէ ամբողջ թիվ. "; | ||
int number = 0; | ||
std::cin >> number; | ||
|
||
if( (number & 0x01) == 0x01 ) | ||
std::cout << number << "-ը կենտ է։" << std::endl; | ||
else | ||
std::cout << number << "-ը զույգ է։" << std::endl; | ||
|
||
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,31 @@ | ||
#include <array> | ||
#include <iostream> | ||
#include <string> | ||
|
||
int main() | ||
{ | ||
using namespace std; | ||
|
||
const array<string, 8> planets{ | ||
"Փայլածու", // Մերկուրի | ||
"Արուսյակ", // Վեներա | ||
"Երկիր", | ||
"Հրատ", // Մարս | ||
"Լուսնթագ", // Յուպիտեր | ||
"Երեւակ", // Սատուրն | ||
"Ուրան", | ||
"Նեպտուն" | ||
}; | ||
|
||
cout << "Ներմուծեք մոլորակի համարը. "; | ||
int index = 0; | ||
cin >> index; | ||
|
||
if( index >= 1 && index <= 8 ) | ||
cout << index << " համարով մոլորակը " | ||
<< planets[index-1] << "ն է" << endl; | ||
else | ||
cout << index << " համարով մոլորակ չկա։" << endl; | ||
|
||
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,30 @@ | ||
#include <iostream> | ||
#include <string> | ||
#include <vector> | ||
|
||
int main() | ||
{ | ||
using namespace std; | ||
|
||
vector<string> planets; | ||
planets.push_back("Փայլածու"); // Մերկուրի | ||
planets.push_back("Արուսյակ"); // Վեներա | ||
planets.push_back("Երկիր"); | ||
planets.push_back("Հրատ"); // Մարս | ||
planets.push_back("Լուսնթագ"); // Յուպիտեր | ||
planets.push_back("Երեւակ"); // Սատուրն | ||
planets.push_back("Ուրան"); | ||
planets.push_back("Նեպտուն"); | ||
|
||
cout << "Ներմուծեք մոլորակի համարը. "; | ||
int index = 0; | ||
cin >> index; | ||
|
||
if( index >= 1 && index <= 8 ) | ||
cout << index << " համարով մոլորակը " | ||
<< planets[index-1] << "ն է" << endl; | ||
else | ||
cout << index << " համարով մոլորակ չկա։" << endl; | ||
|
||
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,17 @@ | ||
#include <iostream> | ||
|
||
int main() | ||
{ | ||
std::cout << "Ներմուծեք որևէ ամբողջ թիվ. "; | ||
int number = 0; | ||
std::cin >> number; | ||
|
||
if( number > 0 ) | ||
std::cout << number << "-ը դրական է։" << std::endl; | ||
else if( number < 0 ) | ||
std::cout << number << "-ը բացասական է։" << std::endl; | ||
else | ||
std::cout << "ներմուծված թիվը զրո է։" << std::endl; | ||
|
||
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,34 @@ | ||
#include <iostream> | ||
#include <numbers> | ||
|
||
int main() | ||
{ | ||
using namespace std; | ||
|
||
cout << "Գնդի տրամագիծը (սմ). "; | ||
double diameter = 0.0; | ||
cin >> diameter; | ||
|
||
cout << "Գնդի պատի հաստությունը (սմ). "; | ||
double thickness = 0.0; | ||
cin >> thickness; | ||
|
||
const auto radius = diameter / 2; | ||
const auto inner_radius = radius - thickness; | ||
|
||
//const double PI = 3.1415; | ||
using std::numbers::pi; | ||
|
||
const auto inner_volume = (4 * pi * inner_radius * inner_radius * inner_radius) / 3; | ||
cout << "Գնդի խոռոչի ծավալը (սմ³). " << inner_volume << endl; | ||
|
||
const auto surface_area = 4 * pi * radius * radius; | ||
cout << "Գնդի արտաքին մակերեսը (սմ²). " << surface_area << endl; | ||
|
||
const double steel_density = 7.8; // g/sm³ | ||
const auto outer_volume = (4 * pi * radius * radius * radius) / 3; | ||
const auto weight = steel_density * (outer_volume - inner_volume); | ||
cout << "Գնդի զանգվածը (գ). " << weight << endl; | ||
|
||
return 0; | ||
} |