为什么没得错误但是不得运行?请大佬们指点一下
#include<stdio.h>int fun(int a,int b)
{
int max=a>b ?a:b;
int min=a>b? b:a;
int sum=0;
for(int i=min;i<=max;i++)
{
sum+=i;
}
return sum;
}
#include <stdio.h> int fun(int a, int b) { int max = a > b ? a : b; int min = a > b ? b : a; int sum = 0; for (int i = min; i <= max; i++) { sum += i; } return sum; } int main() { int a, b; scanf("%d%d", &a, &b); printf("sum=%d", fun(a, b)); return 0; }