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