gcd.c

来自「8051的IP,采用VHDL语言描述,支持intel的HEX格式,包括中断,定时」· C语言 代码 · 共 40 行

C
40
字号
/* * Copyright (c) 1999 Tony Givargis.  Permission to copy is granted * provided that this header remains intact.  This software is provided * with no warranties. * * Version : 2.4 *//*---------------------------------------------------------------------------*/#include <reg51.h>/*---------------------------------------------------------------------------*/void main() {        unsigned char x=47, y=11;    while (1) {        x = 47;        y = 11;                while( x != y ) {                        if( x > y ) {                                x -= y;                P0 = x;            }            else {                                y -= x;                P1 = y;            }        }        P2 = x;    }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?