openAI write codes. Tried one example:

來源: nearby 2023-02-18 14:45:18 [] [博客] [舊帖] [給我悄悄話] 本文已被閱讀: 次 (554 bytes)
回答: 我也有帖子,不公平青青的山2023-02-18 12:12:14

/*
Write a Java function that recursively computes the power of an integer. The method looks like: public static int power(int base, int exp)
*/

The function is:

上麵是我輸入的要求。下麵是openAI Codex 的回複, 100分!

 

 


public static int power(int base, int exp) {
    if (exp == 0) {
        return 1;
    }
    return base * power(base, exp - 1);
}

請您先登陸,再發跟帖!

發現Adblock插件

如要繼續瀏覽
請支持本站 請務必在本站關閉/移除任何Adblock

關閉Adblock後 請點擊

請參考如何關閉Adblock/Adblock plus

安裝Adblock plus用戶請點擊瀏覽器圖標
選擇“Disable on www.wenxuecity.com”

安裝Adblock用戶請點擊圖標
選擇“don't run on pages on this domain”