警告
    1
    warning C4013: “max”未定义;假设外部返回 int
    d:\vs work\测试\测试\测试.c
    7
    1
    测试
错误
    2
    error C4996: 'getche': The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _getche. See online help for details.
    d:\vs work\测试\测试\测试.c
    9
    1
    测试
错误
    3
    error C2143: 语法错误 : 缺少“;”(在“&&”的前面)
    d:\vs work\测试\测试\测试.c
    18
    1
    测试
    4
    IntelliSense:
  应输入表达式
    d:\vs work\测试\测试\测试.c
    18
    15
    测试
测试了一下,这是错误。
#define _CRT_SECURE_NO_DEPRECATE
#include<stdio.h>
#include<conio.h>
main(){
    int a, b, c;
    scanf("%d%d", &a, &b);
    c = max(a, b);
    printf("%d", c);
    _getch();
}
int max(int x, int y){
    int temp, k, i;
    if (x>y){
        temp = x; x = y; y = temp;
    }
    for (i = 1; i <= x; i++)
    {
        if ((x%i==0) && (y%i==0))
            k = i;
    }
    return(k);
}
这是我把问题扣掉后的代码。。但是我没看懂for 里面的是干嘛的。。刚学C..