fork download
  1. #include <stdio.h>
  2. //練習問題A
  3. int func (int x){
  4. return (x>0)?x:-x ;
  5. }
  6. int main(void) {
  7. int n, m = -3;
  8. n = func(m);
  9. printf("%dの絶対値は%d\n", m,n);
  10. return 0;
  11. }
  12.  
Success #stdin #stdout 0s 5312KB
stdin
Standard input is empty
stdout
-3の絶対値は3