Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,29 @@
* @author Kanahaiya Gupta
*
*/
public class CamelCase {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String s = sc.next();
int count = 1;
for (int i = 0; i < s.length(); i++) {
if (s.charAt(i) >= 65 && s.charAt(i) <= 90) {
count++;
}
}
System.out.println(count);
sc.close();

}
class Solution
{
public static void main(String args[])throws IOException
{
Scanner sc=new Scanner(System.in);
String s;
s=sc.next();
System.out.println(camelCase(s));
}
public static int camelCase(String s)
{
int c,n,i,x;
char p=' ';
s=s+" ";
c=1;
n=s.length();
for(i=0;i<n;i++)
{
p=s.charAt(i);
x=(int)p;
if((x>=65)&&(x<=90))
c++;
}
return c;
}
}