#include<time.h>
#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
一、
/*int main()
{
int arr[] = {1,2,3,4,5,6,7,8,9,10};
int c = 7;
int left = 0;
int right = sizeof(arr)/sizeof(arr[0]) - 1;
int a = ( left + right) / 2 ;
scanf("%d",&c);
while (left <= right)
{
int a = (left + right) / 2;
if ( arr[a] == c)
{
printf("正确\n");
break;
}
else if ( arr[a] < c)
left = a + 1;
else if ( arr[a] > c)
right = a -1;
}
printf("wu\n");
return 0;
}*/
二、
// int main()
// {
// char w[17] = {'w','e','l','c','o','m','e',' ','t','o',' ','b','i','t','!','!','!'};
// char a[] = "#################";
// int b = 0;
// for (b = 0;b < 9;b++)
// {
// a[b] = w[b];
// a[17-b] = w[16-b];
// printf("%s\n",a);
// }
// return 0;
// }
三、猜数字游戏
// int main()
// {
// int a = 0;
// for (a = 0;a < 3;a++)
// {
// char c[] = " ";
// printf("请输入密码>");
// scanf("%s",c);
// if (strcmp(c,"12345") == 0)
// {
// printf("success");
// break;
// }
// else
// {
// printf("重新输入\n");
// }
// }
// return 0;
// }
// void menu()
// {
// printf("1.继续游戏\n");
// printf("0.退出游戏\n");
// }
// void game()
// {
// int num = rand()%100 + 1;
// int input = 0;
// while (1)
// {
// printf("请输入:");
// scanf("%d",&input);
// if (input > num)
// {
// printf("大了\n");
// }
// else if (input < num)
// {
// printf("小了\n");
// }
// else
// {
// printf("success\n");
// break;
// }
// }
// }
四、
// int main()
// {
// int input = 0;
// srand((unsigned)time(NULL));
// do
// {
// menu();
// scanf("%d",&input);
// switch(input)
// {
// case 1:
// game();
// break;
// case 0:
// break;
// default:
// printf("worry\n");
// break;
// }
// }while (input);
// return 0;
// }
// int main()
// {
// int a = 0;
// int b = 0;
// int c = 0;
// scanf("%d %d %d",&a,&b,&c);
// if (a >= b && b >= c)
// printf("%d %d %d",a,b,c);
// else if (a >= c && c >= b)
// printf("%d %d %d",a,c,b);
// else if (b >= a && a >= c)
// printf("%d %d %d",b,a,c);
// else if (b >= c && c >= a)
// printf("%d %d %d",b,c,a);
// else if (c >= a && a >= b)
// printf("%d %d %d",c,a,b);
// else
// printf("%d %d %d",c,b,a);
// return 0;
// }
// int main()
// {
// int a = 0;
// for (a = 1;a < 101;a++)
// {
// if ( a%3 == 0)
// printf("%d\n",a);
// }
// return 0;
// }
五、
int main()
{
int a = 0;
int b = 0;
int c = 0;
scanf("%d %d",&a,&b);
if (a >= b)
{
for (c = b;c > 0;c--)
{
if (b%c == 0 && a%c == 0)
{
printf("%d\n",c);
break;
}
}
}
else
{
for (c = a;c > 0;c--)
{
if (b%c == 0 && a%c == 0)
{
printf("%d\n",c);
break;
}
}
}
return 0;
}