Over a million developers have joined DZone.

Calendario De Tareas Repetitivas

·
Otro programa de calendario que muestra las tareas repetitivas semanalmente durante un tiempo determinado


#include 

using namespace std;

char nmeses[12][11]={ "Enero",
	 				"Febrero",
					"Marzo",
					"Abril",
					"Mayo",
					"Junio",
					"Julio",
					"Agosto",
					"Septiembre",
					"Octubre",
					"Noviembre",
					"Diciembre"};

char ndias[7][10]={ "Domingo",
	 				"Lunes",
	 				"Martes",
					 "Miercoles",
					 "Jueves",
					 "Viernes",
					 "Sabado",
					 };
					
int meses[12]={31,28,31,30,31,30,31,31,30,31,30,31};


int main(){
	int i,j,k,l;
	int cont=6;
	
	int clases[9][200][2];
	int contc[9]={0,0,0,0,0,0,0,0,0};
	int semana[9][4]={ {2,2,3,-1},
					   {2,2,4,-1},
					   {3,5,5,-1},
					   {3,5,5,-1},
					   {1,4,4,-1},
					   {4,4,5,-1},
					   {2,4,5,-1},
					   {1,1,3,3},
					   {1,1,3,3}};
	ofstream arc("clases.txt");
		
	for (i=0;i<12;i++){
		for (j=1;j<=meses[i];j++,cont++){			
			if (! ((i==0 && j>0 && j<24) || (i==2 && j>=21 && j<28))){
			for (k=0;k<9;k++){
				for (l=0;l<4 && semana[k][l]!=-1;l++){
					if (cont%7==semana[k][l]){
					   clases[k][contc[k]][0]=i;
					   clases[k][contc[k]][1]=j;
					   contc[k]++;	
		   			}
				}
			} 
			}
		}	
	}

	for (i=0;i
Topics:

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}