c++

câu 1::uscln & bscnn

#include<iostream.h>

void main (){

int a,b,us,bs;

cout<<"nhap a: ";cin>>a;

cout<<" nhap b: ";cin>>b;

int aa=a;

int bb=b;

while (a!=0 && b!=0){

int r=a%b;

a=b;b=r;}

us= a+b;

bs=((aa*bb)/us);

cout<<"uscln la: "<<us<<endl;

cout<<"bscnn la: "<<bs<<endl;}

 

 câu 2:

 

Bạn đang đọc truyện trên: AzTruyen.Top

Tags: