#include<stdio.h>
int main(){
int T = 0,n = 1,b = 0,c = 0;
double f = 0;
while(scanf("%d",&T) != EOF){
for(int i = 0;i < T;i++){
scanf("%lf",&f);
for(int a = 0.250;c == 1;n++){
if(f <= a || f >= (1 - a)){
if(f == a || f == (1 - a)){
printf("-1\n");
}
b = n * 4;
printf("%d\n",b);
c = 1;
}
c = 2;
}
}
}
return 0;
}
这是我写的代码为什么输入数字没有结果显示
测试数据 3
0.375 -1
0.001 4
0.478 20
int main(){
int T = 0,n = 1,b = 0,c = 0;
double f = 0;
while(scanf("%d",&T) != EOF){
for(int i = 0;i < T;i++){
scanf("%lf",&f);
for(int a = 0.250;c == 1;n++){
if(f <= a || f >= (1 - a)){
if(f == a || f == (1 - a)){
printf("-1\n");
}
b = n * 4;
printf("%d\n",b);
c = 1;
}
c = 2;
}
}
}
return 0;
}
这是我写的代码为什么输入数字没有结果显示
测试数据 3
0.375 -1
0.001 4
0.478 20