diff --git a/2ano/1semestre/README.md b/2ano/1semestre/README.md index ced4321..b13f537 100644 --- a/2ano/1semestre/README.md +++ b/2ano/1semestre/README.md @@ -1,7 +1,7 @@ # 1º Semestre ## Todo o material das cadeiras do 1º semestre do 2º ano: -- [Algorítmos e Estruturas de Dados](https://github.com/TiagoRG/uaveiro-leci/tree/master/2ano/1semestre/aed) +- [Algoritmos e Estruturas de Dados](https://github.com/TiagoRG/uaveiro-leci/tree/master/2ano/1semestre/aed) - [Arquiteturas de Computadores 1](https://github.com/TiagoRG/uaveiro-leci/tree/master/2ano/1semestre/ac1) - [Redes de Comunicação](https://github.com/TiagoRG/uaveiro-leci/tree/master/2ano/1semestre/rc1) - [Mecânica e Campo Eletromagnético](https://github.com/TiagoRG/uaveiro-leci/tree/master/2ano/1semestre/mce) diff --git a/2ano/1semestre/aed/README.md b/2ano/1semestre/aed/README.md index 46da423..43d0fdf 100644 --- a/2ano/1semestre/aed/README.md +++ b/2ano/1semestre/aed/README.md @@ -1,4 +1,4 @@ -# Algorítmos e Estruturas de Dados +# Algoritmos e Estruturas de Dados ### Projetos + resoluções de exercícios organizados por aulas ### Linguagem usada: C diff --git a/2ano/1semestre/aed/aula01/AED_Guiao_01.pdf b/2ano/1semestre/aed/aula01/AED_Guiao_01.pdf new file mode 100644 index 0000000..0af0467 Binary files /dev/null and b/2ano/1semestre/aed/aula01/AED_Guiao_01.pdf differ diff --git a/2ano/1semestre/aed/aula01/ProgA b/2ano/1semestre/aed/aula01/ProgA new file mode 100755 index 0000000..b52d5b2 Binary files /dev/null and b/2ano/1semestre/aed/aula01/ProgA differ diff --git a/2ano/1semestre/aed/aula01/ProgA.c b/2ano/1semestre/aed/aula01/ProgA.c new file mode 100644 index 0000000..1a48a6f --- /dev/null +++ b/2ano/1semestre/aed/aula01/ProgA.c @@ -0,0 +1,36 @@ +#include + +int arr_length(int arr[]) +{ + int count = 0; + for(int i=0; arr[i]!='\0'; i++) { + count++; + } + return count; +} + +void print_array(char s[], int arr[]) { + printf("%s:\n", s); + for (int i=0; i +#include + +int main() { + char name[50]; + + scanf("Test: %s", name); + printf("Hello, %s", name); + return 0; +} diff --git a/2ano/1semestre/aed/aula01/prim_types b/2ano/1semestre/aed/aula01/prim_types new file mode 100755 index 0000000..fbc5578 Binary files /dev/null and b/2ano/1semestre/aed/aula01/prim_types differ diff --git a/2ano/1semestre/aed/aula01/prim_types.c b/2ano/1semestre/aed/aula01/prim_types.c new file mode 100644 index 0000000..5e64446 --- /dev/null +++ b/2ano/1semestre/aed/aula01/prim_types.c @@ -0,0 +1,13 @@ +#include + +int main() { + printf("Sizeof(void *) ...... %ld\n", sizeof(void *)); + printf("Sizeof(void) ........ %ld\n", sizeof(void)); + printf("Sizeof(char) ........ %ld\n", sizeof(char)); + printf("Sizeof(short) ....... %ld\n", sizeof(short)); + printf("Sizeof(int) ......... %ld\n", sizeof(int)); + printf("Sizeof(long) ........ %ld\n", sizeof(long)); + printf("Sizeof(long long) ... %ld\n", sizeof(long long)); + printf("Sizeof(float) ....... %ld\n", sizeof(float)); + printf("Sizeof(double) ...... %ld\n", sizeof(double)); +} diff --git a/2ano/1semestre/aed/aula01/simplest_1 b/2ano/1semestre/aed/aula01/simplest_1 new file mode 100755 index 0000000..5239a04 Binary files /dev/null and b/2ano/1semestre/aed/aula01/simplest_1 differ diff --git a/2ano/1semestre/aed/aula01/simplest_1.c b/2ano/1semestre/aed/aula01/simplest_1.c new file mode 100644 index 0000000..cc61b87 --- /dev/null +++ b/2ano/1semestre/aed/aula01/simplest_1.c @@ -0,0 +1,8 @@ +#include + +int main() { + printf("Hello world!\n"); + printf("%ld\n", __STDC_VERSION__); + + return 0; +} diff --git a/2ano/1semestre/aed/aula01/table1 b/2ano/1semestre/aed/aula01/table1 new file mode 100755 index 0000000..de49c8c Binary files /dev/null and b/2ano/1semestre/aed/aula01/table1 differ diff --git a/2ano/1semestre/aed/aula01/table1.c b/2ano/1semestre/aed/aula01/table1.c new file mode 100644 index 0000000..f44d680 --- /dev/null +++ b/2ano/1semestre/aed/aula01/table1.c @@ -0,0 +1,16 @@ +#include +#include + +int main() { + int lines; + + printf("Número de linhas: "); + scanf("%d", &lines); + + printf("%5s | %10s | %s \n", "Number", "Square", "Square Root"); + for(int i = 1; i<=lines; i++) { + printf("%6d | %10d | %.4f\n", i, i*i, sqrt(i)); + } + + return 0; +} diff --git a/2ano/1semestre/aed/aula01/table2 b/2ano/1semestre/aed/aula01/table2 new file mode 100755 index 0000000..023be08 Binary files /dev/null and b/2ano/1semestre/aed/aula01/table2 differ diff --git a/2ano/1semestre/aed/aula01/table2.c b/2ano/1semestre/aed/aula01/table2.c new file mode 100644 index 0000000..c61e584 --- /dev/null +++ b/2ano/1semestre/aed/aula01/table2.c @@ -0,0 +1,20 @@ +#include +#include +#define to_rad(deg) ((deg)*M_PI/180) + +int main() { + FILE *output_file; + + output_file = fopen("table2.txt", "w"); + + printf("%3s | %s | %s\n", "ang", "sin(ang)", "cos(ang)"); + fprintf(output_file, "%3s | %s | %s\n", "ang", "sin(ang)", "cos(ang)"); + + for (int i = 0; i < 360; i+=5) { + printf("%3d | %.5f | %.5f\n", i, sin(to_rad(i)), cos(to_rad(i))); + fprintf(output_file, "%3d | %.5f | %.5f\n", i, sin(to_rad(i)), cos(to_rad(i))); + } + + fclose(output_file); + return 0; +} diff --git a/2ano/1semestre/aed/aula01/table2.txt b/2ano/1semestre/aed/aula01/table2.txt new file mode 100644 index 0000000..a622ca4 --- /dev/null +++ b/2ano/1semestre/aed/aula01/table2.txt @@ -0,0 +1,73 @@ +ang | sin(ang) | cos(ang) + 0 | 0.00000 | 1.00000 + 5 | 0.08716 | 0.99619 + 10 | 0.17365 | 0.98481 + 15 | 0.25882 | 0.96593 + 20 | 0.34202 | 0.93969 + 25 | 0.42262 | 0.90631 + 30 | 0.50000 | 0.86603 + 35 | 0.57358 | 0.81915 + 40 | 0.64279 | 0.76604 + 45 | 0.70711 | 0.70711 + 50 | 0.76604 | 0.64279 + 55 | 0.81915 | 0.57358 + 60 | 0.86603 | 0.50000 + 65 | 0.90631 | 0.42262 + 70 | 0.93969 | 0.34202 + 75 | 0.96593 | 0.25882 + 80 | 0.98481 | 0.17365 + 85 | 0.99619 | 0.08716 + 90 | 1.00000 | 0.00000 + 95 | 0.99619 | -0.08716 +100 | 0.98481 | -0.17365 +105 | 0.96593 | -0.25882 +110 | 0.93969 | -0.34202 +115 | 0.90631 | -0.42262 +120 | 0.86603 | -0.50000 +125 | 0.81915 | -0.57358 +130 | 0.76604 | -0.64279 +135 | 0.70711 | -0.70711 +140 | 0.64279 | -0.76604 +145 | 0.57358 | -0.81915 +150 | 0.50000 | -0.86603 +155 | 0.42262 | -0.90631 +160 | 0.34202 | -0.93969 +165 | 0.25882 | -0.96593 +170 | 0.17365 | -0.98481 +175 | 0.08716 | -0.99619 +180 | 0.00000 | -1.00000 +185 | -0.08716 | -0.99619 +190 | -0.17365 | -0.98481 +195 | -0.25882 | -0.96593 +200 | -0.34202 | -0.93969 +205 | -0.42262 | -0.90631 +210 | -0.50000 | -0.86603 +215 | -0.57358 | -0.81915 +220 | -0.64279 | -0.76604 +225 | -0.70711 | -0.70711 +230 | -0.76604 | -0.64279 +235 | -0.81915 | -0.57358 +240 | -0.86603 | -0.50000 +245 | -0.90631 | -0.42262 +250 | -0.93969 | -0.34202 +255 | -0.96593 | -0.25882 +260 | -0.98481 | -0.17365 +265 | -0.99619 | -0.08716 +270 | -1.00000 | -0.00000 +275 | -0.99619 | 0.08716 +280 | -0.98481 | 0.17365 +285 | -0.96593 | 0.25882 +290 | -0.93969 | 0.34202 +295 | -0.90631 | 0.42262 +300 | -0.86603 | 0.50000 +305 | -0.81915 | 0.57358 +310 | -0.76604 | 0.64279 +315 | -0.70711 | 0.70711 +320 | -0.64279 | 0.76604 +325 | -0.57358 | 0.81915 +330 | -0.50000 | 0.86603 +335 | -0.42262 | 0.90631 +340 | -0.34202 | 0.93969 +345 | -0.25882 | 0.96593 +350 | -0.17365 | 0.98481 +355 | -0.08716 | 0.99619 diff --git a/2ano/1semestre/aed/slides/01_AED_Linguagem_C_I.pdf b/2ano/1semestre/aed/slides/01_AED_Linguagem_C_I.pdf new file mode 100644 index 0000000..fd41112 Binary files /dev/null and b/2ano/1semestre/aed/slides/01_AED_Linguagem_C_I.pdf differ diff --git a/2ano/README.md b/2ano/README.md index 95b892e..33d0524 100644 --- a/2ano/README.md +++ b/2ano/README.md @@ -2,7 +2,7 @@ ## Todo o material das cadeiras do 2º ano: ### [1º Semestre](https://github.com/TiagoRG/uaveiro-leci/tree/master/2ano/1semestre) - - [Algorítmos e Estruturas de Dados](https://github.com/TiagoRG/uaveiro-leci/tree/master/2ano/1semestre/aed) + - [Algoritmos e Estruturas de Dados](https://github.com/TiagoRG/uaveiro-leci/tree/master/2ano/1semestre/aed) - [Arquiteturas de Computadores 1](https://github.com/TiagoRG/uaveiro-leci/tree/master/2ano/1semestre/ac1) - [Redes de Comunicação](https://github.com/TiagoRG/uaveiro-leci/tree/master/2ano/1semestre/rc1) - [Mecânica e Campo Eletromagnético](https://github.com/TiagoRG/uaveiro-leci/tree/master/2ano/1semestre/mce) diff --git a/README.md b/README.md index 2ffd085..e0f8633 100755 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ Pode usar todo o material/código/etc. disponibilizado mas é expressamente proi ## [2º Ano](https://github.com/TiagoRG/uaveiro-leci/tree/master/2ano/1semestre) - ### [1º Semestre](https://github.com/TiagoRG/uaveiro-leci/tree/master/2ano/1semestre) - - [Algorítmos e Estruturas de Dados](https://github.com/TiagoRG/uaveiro-leci/tree/master/2ano/1semestre/aed) + - [Algoritmos e Estruturas de Dados](https://github.com/TiagoRG/uaveiro-leci/tree/master/2ano/1semestre/aed) - [Arquiteturas de Computadores 1](https://github.com/TiagoRG/uaveiro-leci/tree/master/2ano/1semestre/ac1) - [Redes de Comunicação](https://github.com/TiagoRG/uaveiro-leci/tree/master/2ano/1semestre/rc1) - [Mecânica e Campo Eletromagnético](https://github.com/TiagoRG/uaveiro-leci/tree/master/2ano/1semestre/mce)