#include <iostream>
using namespace std;
int main() {
    cout << "Podaj 2 liczby do wyznaczenia NWD" << std::endl;

    int a, b;
    cin >>a;
    cin >>b;
    while (a>0 && b>0)
        if (a>b)
            a=a%b;
    else
            b=b%a;
    if(a>b)
     cout << "NWD = "      <<a<<endl;
    else
        cout << "NWD = "      <<b<<endl;
    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: