-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathprograma para tp algoritmos.c
125 lines (87 loc) · 2.13 KB
/
programa para tp algoritmos.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
#include <string.h>
#include<time.h>
#include <locale.h>
void encabezado(){
printf("\n====================================================\n\n");
printf("EL KIOSKITO DE LA UNO\n\n");
printf("CUIT 30-23456789-5\n\n");
printf("TELEFONO: 0220 4965878\n\n");
printf("EMAIL: [email protected]\n\n");
printf("DIRECCION: renan 1190\n\n");
struct tm *outtime;
time_t hora;
time(&hora);
outtime=localtime(&hora);
printf("%.19s \n", asctime(outtime));
printf("====================================================");
}
main (){
const char usuario [15]="admin";
const char clave [15]="1234";
char usuario_u[15];
char clave_u [15];
int intentos=0;
int correcta=0;
int n_opcion;
setlocale (LC_ALL, "spanish");
do{
system("cls");
printf("\t\t \n INICIO DE SESION\n\n\n");
printf("usuario: ");
fflush(stdin);
scanf("%s", &usuario_u);
printf("clave: ");
fflush(stdin);
scanf("%s", &clave_u);
if (strcmp(usuario, usuario_u)==0 && strcmp (clave, clave_u)==0){
correcta=1;
}
else {
intentos++;
}
}
while (intentos<3 && correcta==0);
if (correcta=1 && intentos<3){
system ("cls");
encabezado();
system("color 6");
printf("\n\n\t\t BIENVENIDO AL SISTEMA\n ");
printf("\n\t\t MENU ");
printf("\n1-VENTAS\n2-COMPRAS\n3-STOCK\n4-PROVEEDORES\n\n0-SALIR");
}
else {
system("cls");
printf("Ha superado cantidad maxima de intentos\n");
system("pause");
exit(0);
}
printf("\n\n Ingrese el numero que corresponda a la opcion deseada:\n ");
scanf("%i", & n_opcion);
switch(n_opcion){
case 0:
printf("SALIR");
break;
case 1:
system("cls");
system("color 4");
encabezado();
printf("VENTAS");
break;
case 2:
printf("COMPRAS");
break;
case 3:
printf("STOCK");
break;
case 4:
printf("PROVEEDORES");
break;
default:
printf("INGRESE OPCION VALIDA");
}
getch();
return 0;
}