Muhammad al-Xorazmiy nomidagi Toshknet axborot texnologiyalari universiteti Dasturiy injiniring 310-20 guruh talabasi Orziyev Orzibekning Dasturlash fanidan labaratoriya ishi.
2-misol
Berilgan 10 ta natural sonlarning eng kata umumiy bo’luvchisi topilsin.
#include
#include
using namespace std;
int main () {
int a,b,k=2,q,n;
cout<<"1-son ="; cin>>a;
cout<<"2-son ="; cin>>b;
while (k<10){
while (a%b!=0){
q=a%b; a=b; b=q;}
k++;
cout<<" "<>n;
a=n;
}
cout<<" EKUB = "< return 0;
}
Uyga vazifa
#include
using namespace std;
int main(){
int x,y,z,d;
cin>>x;
for(y=1; y<=x;y++){
for(z=1; z<=x-y;z++)
cout<<" ";
for(d=1; d<=2*y-1; d++)
cout<<"*";
cout< for(y=1; y<=x;y++){
for(z=1; z<=x-y;z++)
cout<<" ";
for(d=1; d<=2*y-1; d++)
cout<<"*";
cout< for(y=1; y<=x;y++){
for(z=1; z<=x-y;z++)
cout<<" ";
for(d=1; d<=2*y-1; d++)
cout<<"*";
cout<
}
Do'stlaringiz bilan baham: |