⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 c07.cpp

📁 此文件可以能帮你求体积
💻 CPP
字号:
// c07.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"

#include <stdio.h>

int main(int argc, char* argv[])
{
	int a, b, d, min, t = 0;
	
	printf( "Enter two numbers:" );
	scanf( "%d %d", &a, &b );

	min = (a>b)?b:a;
/*
	for ( d = 2; d <= min; d++ )
		if ( (a%d==0) && (b%d==0) )
			t = d;
*/
	for ( d = min; d >= 2; d-- )
		if ( (a%d==0) && (b%d==0) )
		{
			t = d;
			break;
		}

	if ( t == 0 )
		printf( "No greatest common divisior.\n" );
	else
		printf( "The greatest common divisor is %d.\n", t );

	return 0;
}

⌨️ 快捷键说明

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