📄 project2.c
字号:
///////////////////////////////////////////////
// Bulent Orun 21379809650 //
// Group D //
// Greatest Common Divisors //
// Project //
// //
///////////////////////////////////////////////
#include <stdio.h>
int main()
{
int toplam=0,obeb,i,sayi1,sayi2;
while(toplam<2500){
printf("Enter 1st number:");
scanf("%d",&sayi1);
printf("\nEnter 2nd number:");
scanf("%d",& sayi2);
if(sayi1 > sayi2){
i = sayi1;}
else{
i = sayi2;}
for (; i>0; i --){
if (sayi1 % i == 0 && sayi2 % i == 0){
obeb = i;
printf("\nThe greatest common divisor is %d\n",obeb);
toplam = toplam + obeb;
break;}}}
printf("\nThe summation of greatest common divisors is: %d\n",toplam);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -