forked from icei-pucminas/aeds2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
158 additions
and
66 deletions.
There are no files selected for viewing
80 changes: 40 additions & 40 deletions
80
...01 - Aquecimento/LAB01Q01Aquecimento.java → ...mento Interativo/LAB01Q01Aquecimento.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,40 @@ | ||
class LAB01Q01Aquecimento { | ||
public static boolean isMaiuscula (char c){ | ||
return (c >= 'A' && c <= 'Z'); | ||
} | ||
|
||
public static boolean isFim(String s){ | ||
return (s.length() == 3 && s.charAt(0) == 'F' && s.charAt(1) == 'I' && s.charAt(2) == 'M'); | ||
} | ||
|
||
/* | ||
* | ||
*/ | ||
public static int contarLetrasMaiusculas (String s, int pos){ | ||
int resp = 0; | ||
if(pos < s.length()){ | ||
if(isMaiuscula(s.charAt(pos)) == true){ | ||
resp = 1 + contarLetrasMaiusculas (s, pos + 1); | ||
} else { | ||
resp = contarLetrasMaiusculas (s, pos + 1); | ||
} | ||
} | ||
return resp; | ||
} | ||
|
||
public static void main (String[] args){ | ||
String[] entrada = new String[1000]; | ||
int numEntrada = 0; | ||
|
||
//Leitura da entrada padrao | ||
do { | ||
entrada[numEntrada] = MyIO.readLine(); | ||
} while (isFim(entrada[numEntrada++]) == false); | ||
numEntrada--; //Desconsiderar ultima linha contendo a palavra FIM | ||
|
||
//Para cada linha de entrada, gerando uma de saida contendo o numero de letras maiusculas da entrada | ||
for(int i = 0; i < numEntrada; i++){ | ||
MyIO.println(contarLetrasMaiusculas(entrada[i],0)); | ||
} | ||
} | ||
} | ||
class LAB01Q01Aquecimento { | ||
public static boolean isMaiuscula (char c){ | ||
return (c >= 'A' && c <= 'Z'); | ||
} | ||
|
||
public static boolean isFim(String s){ | ||
return (s.length() == 3 && s.charAt(0) == 'F' && s.charAt(1) == 'I' && s.charAt(2) == 'M'); | ||
} | ||
|
||
/* | ||
* | ||
*/ | ||
public static int contarLetrasMaiusculas (String s, int pos){ | ||
int resp = 0; | ||
if(pos < s.length()){ | ||
if(isMaiuscula(s.charAt(pos)) == true){ | ||
resp = 1 + contarLetrasMaiusculas (s, pos + 1); | ||
} else { | ||
resp = contarLetrasMaiusculas (s, pos + 1); | ||
} | ||
} | ||
return resp; | ||
} | ||
|
||
public static void main (String[] args){ | ||
String[] entrada = new String[1000]; | ||
int numEntrada = 0; | ||
|
||
//Leitura da entrada padrao | ||
do { | ||
entrada[numEntrada] = MyIO.readLine(); | ||
} while (isFim(entrada[numEntrada++]) == false); | ||
numEntrada--; //Desconsiderar ultima linha contendo a palavra FIM | ||
|
||
//Para cada linha de entrada, gerando uma de saida contendo o numero de letras maiusculas da entrada | ||
for(int i = 0; i < numEntrada; i++){ | ||
MyIO.println(contarLetrasMaiusculas(entrada[i],0)); | ||
} | ||
} | ||
} |
28 changes: 14 additions & 14 deletions
28
...ntradaSaida/LAB01Q01 - Aquecimento/pub.in → .../LAB01Q01 - Aquecimento Interativo/pub.in
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
Algoritmos e Estruturas de Dados I | ||
Computadores e Sociedade | ||
Geometria Anal�tica | ||
Introdu��o � Ci�ncia da Computa��o | ||
Lab. de Programa��o Visual | ||
Semin�rios I | ||
Algoritmos e Estruturas de Dados II | ||
Arquitetura de Computadores I | ||
C�lculo I | ||
Cultura Religiosa: Fen�meno Religioso (Cultura I) | ||
Matem�tica Discreta | ||
Semin�rios II | ||
FIM | ||
Algoritmos e Estruturas de Dados I | ||
Computadores e Sociedade | ||
Geometria Anal�tica | ||
Introdu��o � Ci�ncia da Computa��o | ||
Lab. de Programa��o Visual | ||
Semin�rios I | ||
Algoritmos e Estruturas de Dados II | ||
Arquitetura de Computadores I | ||
C�lculo I | ||
Cultura Religiosa: Fen�meno Religioso (Cultura I) | ||
Matem�tica Discreta | ||
Semin�rios II | ||
FIM | ||
|
24 changes: 12 additions & 12 deletions
24
...tradaSaida/LAB01Q01 - Aquecimento/pub.out → ...LAB01Q01 - Aquecimento Interativo/pub.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
4 | ||
2 | ||
2 | ||
3 | ||
3 | ||
2 | ||
5 | ||
3 | ||
2 | ||
6 | ||
2 | ||
3 | ||
4 | ||
2 | ||
2 | ||
3 | ||
3 | ||
2 | ||
5 | ||
3 | ||
2 | ||
6 | ||
2 | ||
3 |
40 changes: 40 additions & 0 deletions
40
labs/lab01/entradaSaida/LAB01Q03 - Aquecimento Interativo em C/LAB01Q01Aquecimento.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
class LAB01Q01Aquecimento { | ||
public static boolean isMaiuscula (char c){ | ||
return (c >= 'A' && c <= 'Z'); | ||
} | ||
|
||
public static boolean isFim(String s){ | ||
return (s.length() == 3 && s.charAt(0) == 'F' && s.charAt(1) == 'I' && s.charAt(2) == 'M'); | ||
} | ||
|
||
/* | ||
* | ||
*/ | ||
public static int contarLetrasMaiusculas (String s, int pos){ | ||
int resp = 0; | ||
if(pos < s.length()){ | ||
if(isMaiuscula(s.charAt(pos)) == true){ | ||
resp = 1 + contarLetrasMaiusculas (s, pos + 1); | ||
} else { | ||
resp = contarLetrasMaiusculas (s, pos + 1); | ||
} | ||
} | ||
return resp; | ||
} | ||
|
||
public static void main (String[] args){ | ||
String[] entrada = new String[1000]; | ||
int numEntrada = 0; | ||
|
||
//Leitura da entrada padrao | ||
do { | ||
entrada[numEntrada] = MyIO.readLine(); | ||
} while (isFim(entrada[numEntrada++]) == false); | ||
numEntrada--; //Desconsiderar ultima linha contendo a palavra FIM | ||
|
||
//Para cada linha de entrada, gerando uma de saida contendo o numero de letras maiusculas da entrada | ||
for(int i = 0; i < numEntrada; i++){ | ||
MyIO.println(contarLetrasMaiusculas(entrada[i],0)); | ||
} | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
labs/lab01/entradaSaida/LAB01Q03 - Aquecimento Interativo em C/pub.in
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Algoritmos e Estruturas de Dados I | ||
Computadores e Sociedade | ||
Geometria Anal�tica | ||
Introdu��o � Ci�ncia da Computa��o | ||
Lab. de Programa��o Visual | ||
Semin�rios I | ||
Algoritmos e Estruturas de Dados II | ||
Arquitetura de Computadores I | ||
C�lculo I | ||
Cultura Religiosa: Fen�meno Religioso (Cultura I) | ||
Matem�tica Discreta | ||
Semin�rios II | ||
FIM | ||
|
12 changes: 12 additions & 0 deletions
12
labs/lab01/entradaSaida/LAB01Q03 - Aquecimento Interativo em C/pub.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
4 | ||
2 | ||
2 | ||
3 | ||
3 | ||
2 | ||
5 | ||
3 | ||
2 | ||
6 | ||
2 | ||
3 |
14 changes: 14 additions & 0 deletions
14
labs/lab01/entradaSaida/LAB01Q04 - Aquecimento Recursivo em C/pub.in
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Algoritmos e Estruturas de Dados I | ||
Computadores e Sociedade | ||
Geometria Anal�tica | ||
Introdu��o � Ci�ncia da Computa��o | ||
Lab. de Programa��o Visual | ||
Semin�rios I | ||
Algoritmos e Estruturas de Dados II | ||
Arquitetura de Computadores I | ||
C�lculo I | ||
Cultura Religiosa: Fen�meno Religioso (Cultura I) | ||
Matem�tica Discreta | ||
Semin�rios II | ||
FIM | ||
|
12 changes: 12 additions & 0 deletions
12
labs/lab01/entradaSaida/LAB01Q04 - Aquecimento Recursivo em C/pub.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
4 | ||
2 | ||
2 | ||
3 | ||
3 | ||
2 | ||
5 | ||
3 | ||
2 | ||
6 | ||
2 | ||
3 |