为什么我用visual studio 2008编译C程序时会提示找不到文件,怎么解决,下面是我编写的程序
#include<studio.h>floatmaximum(floatx,floaty);floatminimum(floatx,floaty);voidprn_inf...
#include < studio.h >
float maximum( float x, float y );
float minimum( float x, float y );
void prn_info( void );
int main( void )
{
int i, n;
float max, min, x;
prn_info();
printf( "Input n: " );
scanf( "%d", &n );
printf( "\nInput %d real numbers: ", n );
scanf( "%f", &x );
max = min = x;
for( i = 2; i<=n; ++i ){
scanf( "%f", &x );
max = maximum(max, x);
min = minimum(min, x);
}
printf( "\n%s%11.3f\n%s%11.3f\n\n",
"Maximum value: ", max,
"Minimum value: ", min);
return 0;
}
float maximum(float x, float y)
{
if ( x > y )
return x;
else
return y;
}
float minimum(float x, float y)
{
if ( x < y )
return x;
else
return y;
}
void prn_info(void)
{
printf( "\n%s\n%s\n\n",
"This program reads an integer value for n, and then"
"processes n real numbers to find max and min value.");
}
这个程序是我完全按照书上的打的,不知道是软件的问题,还是程序的问题,还是我把这个程序那个地方打错了 展开
float maximum( float x, float y );
float minimum( float x, float y );
void prn_info( void );
int main( void )
{
int i, n;
float max, min, x;
prn_info();
printf( "Input n: " );
scanf( "%d", &n );
printf( "\nInput %d real numbers: ", n );
scanf( "%f", &x );
max = min = x;
for( i = 2; i<=n; ++i ){
scanf( "%f", &x );
max = maximum(max, x);
min = minimum(min, x);
}
printf( "\n%s%11.3f\n%s%11.3f\n\n",
"Maximum value: ", max,
"Minimum value: ", min);
return 0;
}
float maximum(float x, float y)
{
if ( x > y )
return x;
else
return y;
}
float minimum(float x, float y)
{
if ( x < y )
return x;
else
return y;
}
void prn_info(void)
{
printf( "\n%s\n%s\n\n",
"This program reads an integer value for n, and then"
"processes n real numbers to find max and min value.");
}
这个程序是我完全按照书上的打的,不知道是软件的问题,还是程序的问题,还是我把这个程序那个地方打错了 展开
若以下回答无法解决问题,邀请你更新回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询