Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string.h>
- #include <windows.h>
- using namespace std;
- int main()
- {
- int a = 0, b = 0, NOD = 0, NOK = 0;
- int c = 0, d = 0;
- cout << "Введите два числа (I > II): " << endl;
- cin >> a >> b;
- c = a;
- d = b;
- if(a > b)
- {
- do
- {
- NOD = a%b;
- a = b;
- b = NOD;
- }
- while((a%b) != 0);
- NOK = (c*d)/NOD;
- cout << "NOD = " << NOD << endl;
- cout << "NOK = " << NOK << endl;
- system("cls");
- }
- else
- cout << "Введите I > II !" << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement