zadanie jest takie, żeby obliczyć nww dwóch liczb korzystając z programu na obliczanie nwd i algorytmu euklidesa
#include <iostream>
using namespace std;
int a,b;
int nww(int a,int b);
int nwd(int a,int b);
{
while (a!=b)
{
if(a>b)
a=a-b;
else
b=b-a;
}
return a;
}
int main();
{
cout<<"podaj a:"<<endl;
cin>>a;
cout<<"podaj b:"<<endl;
cin>>b;
cout<<"nww to"<<nww(a,b)=a*b/nwd(a,b)<<endl;
return 0;
}
Mam napisane tyle, wyskakuje mi error w klamerkach {