fork download
  1. /* 正と負の判定 */
  2. // 宮野皓平
  3. #include <stdio.h>
  4. #include <math.h>//関数計算用
  5. int main(void) {
  6. int n;
  7. float a,p;
  8.  
  9. printf("整数値を入力\n");
  10. scanf("%d",&a);
  11. if(a>=0){
  12. p=sqrt(p);
  13. printf("正です:%f\n",p);
  14. } else {
  15. n=a*a;
  16. printf("負です:%d\n",n);
  17. }
  18. return 0;
  19. }
  20.  
Success #stdin #stdout 0s 4436KB
stdin
Standard input is empty
stdout
整数値を入力
正です:0.000000