본문 바로가기
Computer Science/Object Oriented Programming

c++(cpp)_거듭 제곱 구하기(while문 사용)

by hzyiunn 2022. 7. 28.
728x90
반응형
#include <iostream>
#include <iomanip>
using namespace std;

int main()
{
	int num = 1;
	int count = 1;
	cout.imbue(locale(""));
	while (count < 21)
	{
		num *= 2;
		cout << count << '\t' << setw(10) << num << endl;
		count += 1;
	}
	return 0;
}
728x90
반응형

댓글