|
|
вернуться в форум1068 Послано Navid 20 фев 2016 21:12 Why does it keep saying wrong answer? #include<stdio.h> #include<math.h> int main() { int num,element_no;
double sum;
scanf("%d",&num);
if(num<0)
{ element_no = fabs(num) + 2;
}
else
{ element_no = num; }
sum = (element_no/2.0) * (num + 1) ;
int ans = sum; printf("%d\n",ans);
return 0; } |
|
|