累乗

Advertisement

説明

ある値をある回数かけること。

累乗算出

これ、効率悪そう。
public static int getInvokution(int n1, int n2){
    int result = n1;
    for(int i = 0; i < n2 - 1; i++){
        result = result * n1;
    }
    return result;
}

Advertisement

ショートカット

634トップページ
このカテゴリのトップページに戻る
634ラボ

サイト検索

Google

Web サイト内

Y!ログール