meme problem

Revision en2, by zarif_2002, 2018-11-14 15:02:57

include<stdio.h>

include<math.h>

int main(){

int a,t,i;

double y,z;

scanf("%d",&t);

for(i = 0; i < t; i++){

    scanf("%d",&a);

    if(a == 1){

        printf("N\n");
    }
    else{
        y = ((double)a + sqrt((double)a*(double)a - 4*(double)a))/2;

        z = ((double)a - sqrt((double)a*(double)a - 4*(double)a))/2;

        printf("Y %0.9lf %0.9lf\n",y,z);
    }
}
return 0;

why this code shows wrong answer(1076 C)

Tags math and programming

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English zarif_2002 2018-11-14 15:02:57 1 Tiny change: 'eturn 0;\n}\nwhy this' -> 'eturn 0;\n\nwhy this'
en1 English zarif_2002 2018-11-14 15:02:27 537 Initial revision (published)