본문 바로가기
프로그램/C++ 1000제

C++ 81제] 어서와 C++는 처음이지! CHAPTER 02 PROGRAMMING EXERCISE 3.

by 건티 2022. 10. 3.
728x90

출처 : 반크_세계유산 경복궁

 

참고풀이]

#include <iostream>
#include <iomanip> //setw()
using namespace std;

int main()
{
   int days[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
   int i;

   for(i=1;i<13;i++)
   {
      cout << setw(2) << i;
      cout << "월은 ";
      cout << setw(2) << days[i];
      cout << "일까지 있습니다.\n";
   }

   return 0;
}

 

참고풀이 결과]

 

 

 

 

 

대한민국의 아름다운 영토, 독도

 

반응형

댓글