728x90
반응형
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
int colum = 1, row = 1;
while(colum < 11)
{
while(row < 11)
{
int num;
if(colum == row)
{
num = 1;
}
else
{
num = 0;
}
cout << setw(4) << num;
row += 1;
}
cout << endl;
row = 1;
colum += 1;
}
return 0;
}
728x90
반응형
'Computer Science > Object Oriented Programming' 카테고리의 다른 글
c++(cpp)_random matrix(10X10) (0) | 2022.07.28 |
---|---|
c++(cpp)_거듭 제곱 구하기(while문 사용) (1) | 2022.07.28 |
c++(cpp)_거듭 제곱 반환 함수 구현 (0) | 2022.07.28 |
c++(cpp)_성적 산출 (0) | 2022.07.28 |
댓글