|
|
back to boardit say wrong answer,but I have try many numbers! #include <stdio.h> #include<math.h> void main() { float a[1024]; int i=0,count=0; while(scanf_s("%f",&a[i])) { printf("if you want to end press a char\n"); if ((a[i]>0||a[i]==0)&&(a[i]==pow(float(10),18)||a[i]<pow(float(10),18))) {
a[i]=sqrt((float)a[i]); count++; i++; } else break; } getchar();
for (int i=count-1;i>0||i==0;i--) printf("%.4f\n",a[i]);
} |
|
|