fork download
  1. #include <stdio.h>
  2. //引数の絶対値を返す関数
  3. int abs(int x){
  4. (x>0)?x:-x;
  5. return x;
  6.  
  7. }
  8. //引数の二乗を返す関数
  9. int square(int x){
  10. return x*x;
  11.  
  12. }
  13. //main関数
  14. int main(void) {
  15.  
  16. int a,b;
  17. a= 1;
  18. b=2;
  19. printf("|%d^2-%d^2|=%d",a,b,abs(square(a)-square(b)));
  20.  
  21. return 0;
  22. }
  23.  
Success #stdin #stdout 0s 5312KB
stdin
Standard input is empty
stdout
|1^2-2^2|=3