C++ 피라미드
문제 N과 시작 숫자 S가 주어지면 숫자 피라미드를 만드는 프로그램을 작성하시오. 예를 들어, N이 5이고 S가 3 이라면, 그 숫자 피라미드는 3 456 21987 3456789 987654321 입력 입력의 첫 번째 줄에 N과 시작 숫자 S가 주어진다. ( 1≤N≤100, 1 ≤S≤ 9) 5 3 출력 첫 번째 줄부터 숫자 피라미드를 출력한다. #include using namespace std; int temp[9]; int main() { int total,startNum; int array[9]={1,2,3,4,5,6,7,8,9}; int reverse =-1; int position =0; int index =0; cin>> total >> startNum; position = startNum ..
2019. 1. 7.