fork download
  1. #include <stdio.h>
  2.  
  3. int hex(int n){
  4. if(n==1){
  5. return 1;
  6. }else{
  7. return hex(n-1) + 6*n-6;
  8. }
  9. }
  10. int main(void) {
  11. int n=3;
  12. printf("%d",hex(n));
  13.  
  14. return 0;
  15. }
  16.  
Success #stdin #stdout 0.01s 5324KB
stdin
Standard input is empty
stdout
19