toi gian phan so

Màu nền
Font chữ
Font size
Chiều cao dòng

/*chuong trinh toi gian phan so*/

#include<stdio.h>

#include<conio.h>

#include<math.h>

#include<string.h>

int uc(int a,int b)

{

    int tg,t;

    if(b>a)

    {

        t=a;

        a=b;

        b=t;

    }

    while(b!=0)

    {

        tg=a%b;

        a=b;

        b=tg;

    }

    return a;

}

int main()

{

    int ts,ms,i,n,t;

    printf("nhap tu so cua phan so: ");scanf("%d",&ts);

    printf("nhap mau so cua phan so: ");scanf("%d",&ms);

    t=uc(ts,ms);

    printf("phan so sau khi duoc toi gian: %d/%d",ts/t,ms/t);

    getch();

    return 0;

}

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 

Bạn đang đọc truyện trên: Truyen2U.Pro