2025-03-06 23:47:59 +08:00

22 lines
451 B
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*-------------------------------------------------------
功能:依次输入十个整数,找出其平方最大的一个数并打印出来。
--------------------------------------------------------*/
#include <stdio.h>
void main()
{
int i;
float x,y,z=0;
printf("\n请输入10个数");
for(i=1;i<=10;i++)
{
/**********Program**********/
scanf("%f", &x);
if(x*x > z){
z = x*x;
y = x;
}
/********** End **********/
}
printf("平方最大的一个数是:%f\n",y);
}