#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!=b)
        if (a>b)
            a=a-b;
    else
            b=b-a;
    
       cout << "NWD = "      <<a<<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: