Permalink
Browse files

Merge branch 'master' of github.com:VisViva/CPP-Lessons

  • Loading branch information...
2 parents 7aeba85 + 7f75091 commit f75f8df3ceaf36001057cc235c7cd2eea49698e9 Vis Viva committed Apr 11, 2012
Showing with 12 additions and 23 deletions.
  1. +7 −18 Lesson_1
  2. +5 −5 Lesson_2
View
@@ -1,30 +1,19 @@
#include <iostream>
#include <locale>
-using std::cout;
-using std::cin;
-
int main()
{
- setlocale(LC_ALL,"Russian");
-
- double dX(0.0), dY(0.0), dZ(0.0);
- double dVectorLength(0.0);
+ char chLetter('a');
- cout << "\n ������� �: ";
- cin >> dX;
-
- cout << "\n ������� Y: ";
- cin >> dY;
-
- cout << "\n ������� Z: ";
- cin >> dZ;
+ setlocale(LC_ALL,"Russian");
+
+ std::cout << "Введите букву нижнего регистра:\n\n";
- cout << "\n �� ����� ��������� �����: X = " << dX << "; Y = " << dY << "; Z = " << dZ;
+ std::cin >> chLetter;
- dVectorLength = sqrt(dX*dX + dY*dY + dZ*dZ);
+ chLetter = chLetter - 32;
- cout << "\n ����� �������: " << dVectorLength << ". \n\n\a";
+ std::cout << "\nТа же буква в высшем регистре: " << chLetter << ".\n\n";
return 0;
}
View
@@ -11,20 +11,20 @@ int main()
double dX(0.0), dY(0.0), dZ(0.0);
double dVectorLength(0.0);
- cout << "\n ������� �: ";
+ cout << "\n Введите Х: ";
cin >> dX;
- cout << "\n ������� Y: ";
+ cout << "\n Введите Y: ";
cin >> dY;
- cout << "\n ������� Z: ";
+ cout << "\n Введите Z: ";
cin >> dZ;
- cout << "\n �� ����� ��������� �����: X = " << dX << "; Y = " << dY << "; Z = " << dZ;
+ cout << "\n Вы ввели следующие числа: X = " << dX << "; Y = " << dY << "; Z = " << dZ;
dVectorLength = sqrt(dX*dX + dY*dY + dZ*dZ);
- cout << "\n ����� �������: " << dVectorLength << ". \n\n\a";
+ cout << "\n Длина вектора: " << dVectorLength << ". \n\n\a";
return 0;
}

0 comments on commit f75f8df

Please sign in to comment.