Dastur:
#include
#include
using namespace std;
int main(){
int a,a1,b,b1,c,c1;
int sa=0,sb=0,sc=0,ka=0,kb=0,kc=0,min,max;
cout << "a = "; cin >> a;
cout << "a1 = "; cin >> a1;
cout << "b = "; cin >> b;
cout << "b1 = "; cin >> b1;
cout << "c = "; cin >> c;
cout << "c1 = "; cin >> c1;
if(a>a1){ min = a1; max = a;}
else { max = a1; min = a;}
for(int i=1; i<=min; i++) if(min%i==0) sa+=i;
for(int i=1; i<=max; i++) if(max%i==0) ka++;
if(sa==max && ka==min) cout << a << " & " << a1 << " - dust sonlar" << endl;
else cout << a << " & " << a1 << " - dust sonlar emas ! " << endl;
// ------------------------------------------------------------------------------------
if(b>b1){ min = b1; max = b;}
else { max = b1; min = b;}
for(int i=1; i<=min; i++) if(min%i==0) sb+=i;
for(int i=1; i<=max; i++) if(max%i==0) kb++;
if(sb==max && kb==min) cout << b << " & " << b1 << " - dust sonlar" << endl;
else cout << b << " & " << b1 << " - dust sonlar emas ! " << endl;
//--------------------------------------------------------------------------------------
if(c>c1){ min = c1; max = c;}
else { max = c1; min = c;}
for(int i=1; i<=min; i++) if(min%i==0) sc+=i;
for(int i=1; i<=max; i++) if(max%i==0) kc++;
if(sc==max && kc==min) cout << c << " & " << c1 << " - dust sonlar" << endl;
else cout << c << " & " << c1 << " - dust sonlar emas ! " << endl;
}
|