#include <iostream>
using namespace std;
int nwd(int a, int b)
{
if (a==b) return a;
while (a>b)
{
a=a-b;
return nwd(a,b);
}
while (b>a)
{
b=b-a;
return nwd(a,b);
}
}
int main()
{
int t;//t-liczba testow
int *tab = new int[t];
int *tab2 = new int [t];
cout << "Podaj t: "; cin >> t;
cout << "---------" << endl;
for (int i=0;i<=t-1;i++)
{
cout << "Podaj a: "; cin >> tab[i];
cout << "Podaj b: "; cin >> tab2[i];
cout << "-----------" << endl;
nwd(tab[i],tab2[i]);
}
for (int i=0;i<=t-1;i++)
{
cout << "NWD(" << tab[i] << "," << tab2[i] << ") = " << nwd(tab[i],tab2[i]) << endl;
}
return 0;
}
Po kompilacji pojawia się okno z napisem: this application has requested the runtime to terminate it in an unusual way.
Później wyskakuje okienko: Program XYZ przestał działać.
Co to oznacza? Bo wydaje mi się, iż wszystko zostało w miarę dobrze zrobione (:
Poczytałem trochę o tym u wujka G i zainstalowałem jakąś łatkę ale nic nie pomogło. Z góry dzięki za odpowiedzi (: