Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
45 lines (33 loc) · 939 Bytes

File metadata and controls

45 lines (33 loc) · 939 Bytes
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
import java.util.Stack;
public class PYPRan {
public static void main(String[] args) {
int[] a = {5,6,7,9}; //5,6,7,19
int[] m = new int[4]; //5,11,18,19
m[0] = a [0];
char c = 55;
for (int i=0; i <a.length-1; i++){
m [i+1] = Math.max (m[i] + a [i+1], a[i+1]);
}
strVar("HellO");
strVar("There is a quite mouse");
revStr("I am happy");
}
public static void strVar(String input){
char[] a = input.toCharArray();
int countV = 0, countC = 0;
for(int i=0; i<a.length; i++){
if(a[i] == 'a' || a[i] == 'e' || a[i] == 'i' | a[i] == 'o' || a[i] == 'u' || a[i] == 'y') countV++;
else if(a[i] == ' ') continue;
else countC++;
}
System.out.println(countV);
System.out.println(countC);
}
public static void revStr(String input){
Stack<Character> s = new Stack<>();
for(int i=0; i<input.length(); i++){
s.add(new Character(input.charAt(i)));
}
System.out.println(s);
}
}
Morty Proxy This is a proxified and sanitized view of the page, visit original site.