#45803:


chen971023@gmail.com (ZiaynGZiyaNG)

學校 : 國立臺南第二高級中學
編號 : 291750
來源 : [111.255.96.49]
最後登入時間 :
2025-04-07 09:34:22
a621. 1. Powers of Two -- HP CodeWars2007 | From: [122.121.184.213] | 發表日期 : 2025-04-14 23:56

 

#include <iostream>

不能用pow函數

using namespace std;

 

int main()

{

long long n;

cin >> n;

long long result = 1;

for (int i = 0; i <= n; i++)

{

cout << "2^" << i << " = " << result << endl;

result *= 2;

}

}

 
ZeroJudge Forum