Untitled

mail@pastecode.io avatar
unknown
c_cpp
7 months ago
574 B
1
Indexable
Never
#include <iostream>
using namespace std;

int main()
{
	int i = 0;
	int sum = 0;
	while( sum != 12 )
	{
		if (sum == 0){
			cout << "_";
			if (i == 30) {
				cout << endl << "          ";
				sum += 1;
			}
		}
		else if (sum == 12) {
				if (i == 0)cout << "          ";
				cout << "_";
				if (i == 11) {
					sum += 1;
				}
			}
		else 
			if ((i == 0 || i ==11) && sum > 0 && sum < 13)cout << "| ";
			if (sum > 1 && sum < 13) cout << i+sum << " ";
			i += 1;
			if (i % 12 == 0) {
				cout << endl;
				i = 0;
				sum += 1;
			}
	}
}
Leave a Comment