-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsis.c
84 lines (78 loc) · 1.91 KB
/
sis.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
#include "sis.h"
#include "unistd.h"
#include "stdio.h"
#include "stdlib.h"
#include "ctype.h"
#include "locale.h"
#include "time.h"
/*
* veja mais em
* https://github.com/rafatrinity
*/
char SISTEMA;
char apresenta(){
/*
.::::. :: .::::. ||
:: :: :: :: :: ||
:: :: :: :::::: ||
*::::* :::::: :: :: ::
*/
printf("\n\n");
printf("\t\t\t.::::. :: .::::. ||\n");
usleep(200000);
printf("\t\t\t:: :: :: :: :: ||\n");
usleep(200000);
printf("\t\t\t:: :: :: :::::: ||\n");
usleep(200000);
printf("\t\t\t*::::* :::::: :: :: ::\n\n");
printf("\n\n");
printf("\tPOR GENTILEZA, INFORME QUAL SISTEMA OPERACIONAL VC UTILIZA:\n\n\tD=DOS\n\tU=UNIX\n\n");
printf("\t\tDUVIDAS? DIGITE (i) PARA MAIS INFORMAÇÕES\n");
printf("\t");
linha();
pergunta:
fflush(stdin);
scanf("%c",&SISTEMA);
SISTEMA=toupper(SISTEMA);
switch(SISTEMA){
case 'D':
system("cls");
fflush(stdin);
break;
case 'U':
system("clear");
fflush(stdin);
break;
case 'I':
printf("\nDOS = Window\nUNIX = Mac e Linux(há exeções)");
getchar();
goto pergunta;
break;
default:
printf("\nENTRADA INVALIDA, FAVOR DIGITAR SOMENTE AS LETRAS INDICADAS\n");
goto pergunta;
}
return SISTEMA;
}
//============================escreve uma linha na tela=========================
int linha(){
usleep(100000);
for (int i = 0; i < 60; ++i)
printf("=");
usleep(100000);
printf("\n");
return 0;
}
//==================================cabeçalho=================================
void cab(){
if (SISTEMA == 'D')
system("cls");
else
system("clear");
time_t t = time(NULL);
struct tm tm = *localtime(&t);
printf("============================================================\n");
printf("\tUNICARIOCA - AGENDA - ");
printf("%d/%d/%d - %d:%d\n",tm.tm_mday,tm.tm_mon+1,tm.tm_year + 1900,tm.tm_hour,tm.tm_min);
printf("============================================================\n\n");
}